我从Win XP 32bit改为Win7 64bit并重新安装了Python 2.7和Anaconda软件包.
但是,它似乎没有正确安装.当我做
import enum
Run Code Online (Sandbox Code Playgroud)
有错误:
ImportError: No module named enum
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试导入pandas时,它可以工作.
在Ipython中输入help()和模块时没有任何反应.
不知道怎么离开这里?
使用scipy.stats时,我得到一个错误.在导入scipy后的脚本中.
AttributeError: 'module' object has no attribute 'stats'
Run Code Online (Sandbox Code Playgroud)
在脚本编辑器中,我可以在输入scipy后点击统计数据.从下拉菜单中,在python控制台中我无法从下拉菜单中选择python.stats,它不在那里.我正在使用pandas 2.7和SciPy 0.13.0为什么会这样?任何已知问题?
我想查询HDF5文件.我做
df.to_hdf(pfad,'df', format='table')
Run Code Online (Sandbox Code Playgroud)
在光盘上写入数据帧.
阅读我用
hdf = pandas.HDFStore(pfad)
Run Code Online (Sandbox Code Playgroud)
我有一个包含numpy.datetime64
称为expirations的值的列表,并尝试将hd5表的一部分读入数据帧,该数据帧具有列之间expirations[1]
和expirations[0]
列之间的值"expiration"
.列到期条目具有格式Timestamp('2002-05-18 00:00:00')
.
我使用以下命令:
df = hdf.select('df',
where=['expiration<expiration[1]','expiration>=expirations[0]'])
Run Code Online (Sandbox Code Playgroud)
但是,这会失败并产生值错误:
ValueError: The passed where expression: [expiration=expirations[0]] contains an invalid variable reference all of the variable refrences must be a reference to an axis (e.g. 'index' or 'columns'), or a data_column The currently defined references are: index,columns
我想使用dataframe.pivot()从pandas数据框创建一个数据透视表,不仅包括数据帧列,还包括数据框索引中的数据.找不到任何显示如何操作的文档.有小费吗?
我在 4GB RAM 上运行 Win7 64Bit。我将一个大数据文件(要读取的 3Mio 行)读入 Pandas 数据帧,执行多个 isin()-Operations 并获得 2 个其他数据帧 df1 和 df2,每个数据帧有 300000 行。直到这里一切正常,总内存消耗约为 40%。但是,当我尝试合并 df1 和 df2 时,RAM 消耗直接上升到几乎 100% 并导致系统冻结。看起来像内存泄漏。有人在观察类似的东西吗?在 pandas.merge() 的屋顶下会发生什么导致这种情况?有没有可能让代码运行?合并命令:
merged=pandas.merge(df1, df2, on=['call/put','expiration'], how='inner', left_index=True, right_index=True)
Run Code Online (Sandbox Code Playgroud) 我编译了一个Cython脚本并运行它。运行它时,我从以下代码行中收到错误:
cdef np.ndarray[float] vola = np.empty(n, dtype=float)
Run Code Online (Sandbox Code Playgroud)
这是为什么?我想稍后用浮点值填充数组vola,所以我想将其格式化为浮点,而不是双精度。