0
嗨,我想解析XLSX文件,我得到了下一個 -解析XLSX文件(BP世界能源統計評論)
import pandas as pd
from pandas import DataFrame, read_csv
path = 'bp-statistical-review-of-world-energy-2015-workbook.xlsx'
xls = pd.ExcelFile(path)
df = pd.read_excel(xls, 'Oil Production – Tonnes', index_col=0, na_values=['NA'])
df.index.name = None
#df.drop([0], axis=0, inplace=True)
#df.drop((['Change']), axis=1, inplace=True)
df.drop(df.columns[[50, 51]], axis=1, inplace=True)
df.drop(df.index[[0, 77, 78, 79, 80, 81, 82, 83]], axis=0, inplace=True)
收到以下缺點,日期,第二行,但不是全部正確顯示,有些日期有一個視圖 - 2015.00000。此外,我不能移動上述日期的行。請幫助我)