Ive tried to find the OLDEST FEMALE from csv dataset, but I dont know how. Im pretty new to Python and Pandas. I clearly dont know how to use if function here.
import pandas as pd
df = pd.read_csv("people.csv", usecols=['gender', 'age'])
I tried to use something like this
print(df[df["gender"].isin(["F"])].df.age.max())
or like this
if df[df["gender"].all(["F"])] :
print(df.age.max())
even tried this
print(df.loc[df['gender'] == 'F'].max())
but this was before I found the oldest 'M' is the same age as the oldest 'F'
but still cant figure out how to find the oldest female
EDIT : I have to find the oldest female from imported dataset, not to create one. Thank you.
EDIT 2 : Sorry for bothering, I just found out, that the oldest M in my csv have the same age as the oldest F in my csv. This is embarassing