让pandas新索引“loc”和“iloc”与PyInstaller一起使用

时间:2013-08-27 16:28:10

标签: python pandas pyinstaller

使用PyInstaller(使用2.0和dev版本测试),我将下面的代码打包为.exe:

import pandas as pd

df = pd.DataFrame([1, 2, 3])
print df.iloc[0]

当我运行可执行文件时,我最终收到以下错误消息:

Traceback (most recent call last):
  File "<string>", line 15, in <module>
  File "C:\Users\username\pyinstaller-2.0\Hello\build\pyi.win32\Hello\out00-PYZ.pyz\pandas.core.frame", line 1879, in __getattr__
AttributeError: 'DataFrame' object has no attribute 'iloc'

如果我用较旧的iloc替换ix,一切都按原样运行,所以我怀疑PyInstaller无法找到/使​​用最新版本的pandas。如何让PyInstaller与iloc一起使用?

我在Windows 7上通过WinPython使用Python 2.7.4和pandas 0.11.0。

0 个答案:

没有答案