I have a dataframe (df) with approx 800 rows with data like this:
Name:Jason
Age: 45
Ticket:1
Name:Kim
Age: 30
Ticket:0
1 = has a ticket 0 = does not have a ticket
(sorry, that didn't format very well. It's basically 3 columns in the dataframe: Name, Age and Ticket)
Using Pandas, I am wondering what the syntax is for find the Top 10 oldest people who HAVE a ticket
So far I have:
df.sort_values('Age',ascending=False,inplace=True)(data.Ticket==1)
(data.head(10))
I know that's not correct but it shows what the parameters are that I am looking for. Any ideas? Thanks