Solution 12.1
Perform the following steps to complete the activity:
- For this activity, you will need the
pandas
andnumpy
libraries. Load them in the first cell of the notebook:import pandas as pd import numpy as np
- Read in the
household_power_consumption.csv
data from theDatasets
directory and list the first few rows:data_fn = 'household_power_consumption.csv' household_electricity = \ Â Â Â Â pd.read_csv('../datasets/' + data_fn, Â Â Â Â sep = ';', Â Â Â Â low_memory = False) household_electricity.head()
This generates the following:
- You should inspect the data types of the columns and further investigate whether there are non-numeric values. If so, correct them by converting them to
NA
values and then filling them by interpolation:Household_electricity.dtypes
This generates the following...