Activity 7.01 – data analysis using pivot tables
In this activity, you will build pivot tables in order to perform data analysis. We will work on the Student Performance dataset from the GitHub repository.
Note
More details about the Student Performance dataset can be found at https://archive.ics.uci.edu/ml/datasets/Student+Performance.
Your tasks will be to do the following:
- Open a Jupyter notebook.
- Import the
pandas
package. - Load the CSV file (using the
;
delimiter to separate the columns) as a DataFrame. - Modify the DataFrame to contain only these columns:
school
,sex
,age
,address
,heath
,absences
,G1
,G2
, andG3
. - Display the first 10 rows of the DataFrame.
- Build a pivot table that is indexed on
school
. - Build a pivot table that is indexed on
school
andage
. - Build a pivot table that is indexed on
school
,sex
, andage
, with the mean and sum aggregation on theabsences
column.
The expected output is as follows:
...