Created
May 31, 2020 14:10
-
-
Save Lawrence-Krukrubo/5d7e570bab00d043cfe10d02a3ee384d to your computer and use it in GitHub Desktop.
adding code snippets to Loading Data Files in python article.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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