using panda to find value matching certain criteria.


Say you have the following dataframe read into panda.

Id | F1    | F2      | Class
0  | True | True   | 0
0  | True | True   | 1
0  | True | True   | 0
0  | True | True   | 1

To select all the class with value 0 in a data frame, you can use

data.loc[data['Class'] == 0]

Class column name is case sensitive. You won't get anything out of using data['class'].


Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm