Home > other >  I want to extract the F line, specify the number of points. This how to do, the elder brother of the
I want to extract the F line, specify the number of points. This how to do, the elder brother of the

Time:09-17



I want to extract the F line, specify the number of points, this how to do, the elder brother of the early,

CodePudding user response:

If the pandas
Df [points] [df (' name ')=="x"]

Should be like this

CodePudding user response:

O code
Thank you very much!!!!!!!!!!

CodePudding user response:

refer to the second floor qing-hua ye response:
o codeThank you very much!!!!!!!!!!


The data in the form of a code to a few lines, typing difficult

CodePudding user response:

 
The import pandas as pd
The import numpy as np
Df=pd DataFrame ([[' AA ', 1, 2, 3], [' BB ', 1, 2, 3], [' CC ', 1, 2, 3], [' DD ', 1, 2, 3]], the columns=[' name ', 'age', 'class', 'type'])
# df=pd read_csv (' XXX. CSV, the header=None)
Df

 
Df=df set_index ([' name '])
Df
 
Df. Loc [' BB ']

Results:
The age of 1
Class 2
Type 3
Name: BB, dtype: int64
 
Df. Loc [' BB '] [' age ']

Results:
1
if help to you, please junction post to encourage

CodePudding user response:

 
The import pandas as pd
# import numpy as np
Df=pd DataFrame ([[' AA ', 1, 2, 3], [' BB ', 1, 2, 3], [' CC ', 1, 2, 3], [' DD ', 1, 2, 3]], the columns=[' name ', 'age', 'class', 'type'])

Print (df)
Print (df [' class '] [df [' name ']=='BB']. Values [0])
Print (df. Loc [df [' name ']=='BB', 'class']. Values [0])
Print (df. Loc [df [' name ']=='BB'] [' class '] values [0])


Use the upstairs data, so to write

CodePudding user response:

I this file path is:
C: \ users \ \ administrator \ desktop \ 4. XLSX

Want to send this file F column and column H three points written in another file
File: c: \ users \ \ administrator \ desktop \ as XLSX first working table,

CodePudding user response:

refer to 6th floor qing-hua ye response:
I this file path is:
C: \ users \ \ administrator \ desktop \ 4. XLSX

Want to send this file F column and column H three points written in another file
File: c: \ users \ \ administrator \ desktop \ as XLSX first working table,

Hand a network location on the file, the example should be used
  • Related