2. Loading and Processing Data
Activity 2.01: Loading Tabular Data and Rescaling Numerical Fields with a MinMax Scaler
Solution:
- Open a new Jupyter notebook to implement this activity. Save the file as
Activity2-01.ipnyb
. - In a new Jupyter Notebook cell, import the pandas library, as follows:
import pandas as pd
- Create a new pandas DataFrame named
df
and read theBias_correction_ucl.csv
file into it. Examine whether your data is properly loaded by printing the resultant DataFrame:df = pd.read_csv('Bias_correction_ucl.csv')
Note
Make sure you change the path (highlighted) to the CSV file based on its location on your system. If you're running the Jupyter notebook from the same directory where the CSV file is stored, you can run the preceding code without any modification.
- Drop the
date
column using thedrop
method. Since you're dropping the columns, pass1
to theaxis
argument andTrue
to theinplace
argument:df.drop(&apos...