Linked Questions

Popular Questions

I want to groupby some athletes by their name an get the smallst age from every person and then sort them by their age from the youngest to the oldest, but in my data there are also some Nan values and i get a FutureWarning: Passing list-likes to .loc or [] with any missing label will raise KeyError in the future, you can use .reindex() as an alternative. Is there any option to skip the records with the Nan values?

Here is my code, tab is a table I read form an csv file which i got from my teacher:

tabYoungest=tab.sort_values(by='Age')  
tabYoungestgesamt=tabYoungest.loc[tabYoungest.groupby('Name')['Age'].idxmin()]
tabYoungestgesamt.head(20)

Related Questions