Pandas dataframe filters data based on column values

Regarding the method, I probably found the following:

1. DataFrame.filter()
2. DataFrame.loc()
3. df[df['字段']==值]
4. df.where(df['字段'] == 值)

The following are the results of four kinds of queries:
1.filter(items=[]) The result seems to be in the form of a list, but it was unsuccessful
2.loc() is queried based on the label, so the parameter is the field name is unreasonable
3.df[df ['Field']==value] Finally used this method, the result is ideal
(here you need to pay attention to the correspondence of the field type, because my value here is of type int, because I put it into a string, it led to a long search Question)
Pandas dataframe filters data based on column values
4 The condition is status = 1000
Pandas dataframe filters data based on column values

Guess you like

Origin blog.51cto.com/14804892/2536389