I'm new to the programming world, and I'm doing some studies to gain knowledge in the area of Data Science.
Come on ... I have a Dataframe with a lot of information, among it gender and age. I want to bring the amount of lines of each gender (male and female) and classify them as children (0 to> 12 years), young people (12 to> 18 years) and adults (18+). >
I'm lost to the point of not knowing or getting started right ...
Input: df.groupby("Sex").Age.unique()
Output:
Sex
female [38.0, 26.0, 35.0, 27.0, 14.0, 4.0, 58.0, 55.0...
male [22.0, 35.0, 29.0, 54.0, 2.0, 20.0, 39.0, 34.0...
Name: Age, dtype: object
Variável:
classification = df.groupby("Sex").Age.unique()
Now imagine that I have to do a for loop, is that it? But how to name each case.