I have done the same thing multiple times earlier but I am not able to select a row based on column value from my pandas dataframe. I also tried making this column as index but didn't work. I can only query the first row. This the the dataframe:
| PLAYER | Pts
|0 | SunilNarine | 379.5|
|1 |Shane Watson | 318.0|
df[df.PLAYER=='SunilNarine']
works fine. Same for any other record doesnt give anything
df[df.PLAYER=='Shane Watson']
does not give anything. I tried making this column as index too, only works for the first record. Also tried:
for player in df['PLAYER']:
if str(player).strip().capitalize=='Shane Watson'.capitalize:
print('Y')
It prints nothing.
I have multiple records, I have only presented two here. Its unable to select any of the rows based on PLAYER column except for the first row. Works fine for other columns. Cant figure out what is going incorrect here.