'filter on pandas dataframe is not working and adding NaN
I have a below dataframe and I m trying to filter the values but its not working
lookup_dfd User Subject Marks Grade 0 Asma SUB A 36 Pass 1 Asma SUB B 106 Fail 2 Asma SUB C 15 Pass 3 Asma SUB D 11 Pass
When I m running this below command, its not filtering the rows instead showing NaN for other rows
lookup_df[lookup_df.Marks == 36] User Subject Marks Grade 0 Asma SUB A 36 Pass 1 NaN NaN NaN NaN 2 NaN NaN NaN NaN 3 NaN NaN NaN NaN
I have also tried to add more filters but still the same results. Refer images
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
