demand
Select the row data in the DataFrame through the & | operation of multiple conditions
method
source data:
StuID | Type | on one | |
---|---|---|---|
0 | 111021 | Math | 89 |
1 | 111021 | English | 93 |
2 | 312983 | English | 91 |
3 | 314621 | English | 82 |
4 | 314621 | Math | 92 |
5 | 112341 | Math | 82 |
Filter conditions:
- StuID = 111021
- Num > 90
- Show only the Num column
Method:
df.loc[(df['StuID']==111021)&(df['Num']>90),['Num']]