1.1 KiB
Exercise 2 Electric power consumption
The goal of this exercise is to learn to manipulate real data with Pandas.
The data set used is Individual household electric power consumption
-
Delete the columns
Time
,Sub_metering_2
andSub_metering_3
-
Set
Date
as index -
Create a function that takes as input the DataFrame with the data set and returns a DataFrame with updated types:
def update_types(df): #TODO return df
-
Use
describe
to have an overview on the data set -
Delete the rows with missing values
-
Modify
Sub_metering_1
by adding 1 to it and multiplying the total by 0.06. If x is a row the output is: (x+1)*0.06 -
Select all the rows for which the Date is greater or equal than 2008-12-27 and
Voltage
is greater or equal than 242 -
Print the 88888th row.
-
What is the date for which the
Global_active_power
is maximal ? -
Sort the first three columns by descending order of
Global_active_power
and ascending order ofVoltage
. -
Compute the daily average of
Global_active_power
.