How to read a .xlsx file using the pandas Library in iPython?

前端 未结 6 453
生来不讨喜
生来不讨喜 2020-11-28 02:27

I want to read a .xlsx file using the Pandas Library of python and port the data to a postgreSQL table.

All I could do up until now is:

im         


        
6条回答
  •  Happy的楠姐
    2020-11-28 03:20

    Assign spreadsheet filename to file

    Load spreadsheet

    Print the sheet names

    Load a sheet into a DataFrame by name: df1

    file = 'example.xlsx'
    xl = pd.ExcelFile(file)
    print(xl.sheet_names)
    df1 = xl.parse('Sheet1')
    

提交回复
热议问题