Loading an Excel Dataset into a DataFrame
Learn to import an Excel dataset into a DataFrame.
We'll cover the following...
Loading Excel files
Sometimes we can store data inside other data sources, such as Excel files. We can also store this data online and access it through a URL.
To import such data, we use the read_excel() pandas function.
Python 3.8
import pandas as pdexcel_df = pd.read_excel("https://github.com/CourseMaterial/DataWrangling/blob/main/housing.xlsx?raw=true")print(excel_df.tail())
Let’s review the code line by line:
Line 1: We import the pandas library.
Line 2: We use the
read_excel()function to read the Excel file with the URLhttps://bit.ly/housingexceldsand store it inexcel_df.Line 3: We print the last five ...