Solution: Reshaping/Aggregations
Explore how to manipulate data in pandas by creating dummy variables, grouping data to calculate means, and building pivot tables. This lesson helps you understand reshaping methods and aggregation techniques to analyze categorical and numerical data efficiently.
We'll cover the following...
We'll cover the following...
Solution 1
Look at the following dataset:
Age 8 10 15 15 72 20 25 30 35 60 68 70 25 85 15Sex M M F F M M M M F F M F F M F
Create dummy columns on the Sex attribute.
Line 7: We use the
get_dummiesfunction to encode theSexcolumn in the data framedfinto ...