Use pandas to read Excel files in Jupyter

Similarly, we can load Microsoft Excel files just as easily. For example, the Excel file for the same Titanic dataset is available at vandebilt.edu (full link in following script). We have the following script:

import pandas as pd
df = pd.read_excel('http://biostat.mc.vanderbilt.edu/wiki/pub/Main/DataSets/titanic3.xls')
print (df.head)  

There is also an extensive set of optional parameters for reading Excel files as well, for example:

  • Select the sheet within the excel file to read
  • Skip rows
  • Specify the handling of NA values

The resultant flow under Jupyter is as follows. The dataset looks very similar to the prior CSV file read in.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.30.253