熊猫数据框输出和OLE2警告

时间:2018-08-21 15:37:26

标签: excel python-3.x pandas

我正在尝试使用Pandas从Excel文档中抓取两列。我能够获取数据,但努力获取正确的输出

# Import pandas
import pandas as pd

# Assign spreadsheet filename to `file`
file = 'DHL_export.xls'

# Load spreadsheet
xl = pd.ExcelFile(file)

df1 = xl.parse('ELExport')

order_number = df1['SITEMS_ORDERNUMBER']
tracking_number = df1['SITEMS_IDENTCODE']

for x in tracking_number:

     print (x)

输出为:

WARNING *** OLE2 inconsistency: SSCS size is 0 but SSAT size is non-zero
1703997
1703998
1703999

我尝试了多种格式化代码的方法,但是只能将其打印为一长串订单号,然后是跟踪号。另外,如何解决*警告OLE2不一致。

所需的输出是:

1703997 CJ844060818DE
1703998 CJ844060821DE
1703999 CJ844060835DE
1704000 CJ844060870DE

0 个答案:

没有答案