Skip to content

Instantly share code, notes, and snippets.

@Lawrence-Krukrubo
Created May 31, 2020 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lawrence-Krukrubo/5d7e570bab00d043cfe10d02a3ee384d to your computer and use it in GitHub Desktop.
Save Lawrence-Krukrubo/5d7e570bab00d043cfe10d02a3ee384d to your computer and use it in GitHub Desktop.
adding code snippets to Loading Data Files in python article.
import numpy as np
import pandas as pd
# First let's save the link to the excel file
battle_link = 'https://assets.datacamp.com/production/repositories/487/datasets/5e8897e4624f8577ed0d33aeafbe7bd88bfc424b/battledeath.xlsx'
# Next let's load the file into an io.excel.base file
xls = pd.ExcelFile(battle_link)
# Let's see its type
print(type(xls))
# >> <pandas.io.excel._base.ExcelFile>
# Next, let's print the sheet names
print(xls.sheet_names)
# >>['2002', '2004']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment