refer to:
dframe = pd.read_excel(“file_name.xlsx”)
dframe = pd.read_excel(“file_name.xlsx”, sheetname=”Sheet_name”)
dframe = pd.read_excel(“file_name.xlsx”, sheetname=number)
原文如下:
//
Reading and writingExcel files in Python pandas
In data science, you are very likely to mostly work with CSV files. However, knowing how to import and export Excel files is also very useful.
In this post, a Kaggle dataset on 2016 US Elections was used (https://www.kaggle.com/benhamner/d/benhamner/2016-us-election/primary-results-sample-data/output). This dataset has been converted from a CSV file to an Excel file and two sheets have been added with votes for Hilary Clinton (HilaryClinton) and Donald Trump (DonaldTrump). The first sheet (All) contains the original dataset.
Reading Excel files
dframe = pd.read_excel(“file_name.xlsx”)
Reading Excel files is very similar to reading CSV files. By