Title: Load Excel Spreadsheet As Pandas Dataframe
Slug: pandas_dataframe_load_xls
Summary: Load Excel Spreadsheet As Pandas Dataframe
Date: 2016-05-01 12:00
Category: Python
Tags: Data Wrangling
Authors: Chris Albon
In [9]:
# import modules
import pandas as pd
In [10]:
# Import the excel file and call it xls_file
xls_file = pd.ExcelFile('../data/example.xls')
xls_file
Out[10]:
In [11]:
# View the excel file's sheet names
xls_file.sheet_names
Out[11]:
In [12]:
# Load the xls file's Sheet1 as a dataframe
df = xls_file.parse('Sheet1')
df
Out[12]: