Pandas中的Read_excel

时间:2017-01-05 15:59:27

标签: pandas converters

使用pandas 0.19.2。

我的目标是阅读一个excel文件并将所有内容保留为字符串,不进行任何转换。

我的excel文件包含以下内容:

Row1 Row 2 52.60 52.80 68.7k 67.5k 0.80% 0.80%

我尝试使用以下命令

读取excel文件
df = pd.read_excel('C:\Dash\static\Calendar-01-01-2017.xls')
df = pd.read_excel('C:\Dash\static\Calendar-01-01-2017.xls', converters={'Row1':str,'Row2':str}))
df = pd.read_excel('C:\Dash\static\Calendar-01-01-2017.xls', converters={0:str,1:str}))

不幸的是我最终得到了这个:

Row1 Row 2 52.6 52.8 68.7k 67.5k 0.008 0.008

最后,我想把它传递给一个清单:

df = df.values.tolist()

但我最终得到的是长值,例如

0.0080000000000001

0 个答案:

没有答案