9. Applications in Business Use Cases and Conclusion of the Course
Activity 9.01: Data Wrangling Task – Fixing UN Data
Solution:
These are the steps to complete this activity:
- Import the required libraries:
import numpy as np import pandas as pd import matplotlib.pyplot as plt import warnings warnings.filterwarnings('ignore')
- Save the URL of the dataset (highlighted) and use the pandas
read_csv
method to directly pass this link and create a DataFrame:education_data_link="http://data.un.org/_Docs/SYB/CSV/"\ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "SYB61_T07_Education.csv" df1 = pd.read_csv(education_data_link)
- Print the data in the DataFrame:
df1.head()
The output (partially shown) is as follows:
- As the first row does not contain useful information, use the
skiprows
parameter to remove the first row...