Pandas use the library to read excel spreadsheet data

Pandas use the library to read excel spreadsheet data

Entering the IT industry, everyone is willing to learn and make progress together, have questions, please point out! !

Data are still reading it a headache, see below concise description:

Data sources for the National Bureau of Statistics website:

Specific method code:

Import PANDAS AS PD DF = PD. read_excel ( 'quanguojingji10nian.xls') # py now Excel spreadsheet with the code in a folder X = DF [ 'index'] # the first column of data read Print ( X) ; # About 'indicators into other column to column names, you can read the other columns'




result:

Results can be read out column x draw a straight line, pie, line library with matplotlib.pyplot

 

Guess you like

Origin www.cnblogs.com/xcuyms/p/11546523.html