+ 2
How to access index or any specific column in pandas using a condition
Marks = { "Science" : [100, 100, 50], "Maths" : [20, 60, 80], "Order" : [1, 2, 3] } Marks_df = pd.DataFrame(marks, index = ["sainath", "Anurag", " Vishnu"] X = marks_df["science"] == 100 It outputs a boolean value Now how do we access the specific column using this condition Let's say I want order and names of those students who scored 100, how do I do it?
5 Antworten
+ 2
Sorry man I made a mistake thanks a lot
0
However this only works if both maths and science has scores equal of "sainath"