我正在尝试使用pandas“cut”方法,但收到object has no attribute
错误。我已经导入了pandas,它适用于其他命令。这是一个已知问题还是我错过了什么?我重新启动Python认为这可能只是一个随机的bug但它似乎不是......
以下完整错误:
python 2.7.3 (default, Sep 26 2013, 20:08:41)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> day1 = pd.read_csv('nyt1.csv') #<-- THIS WORKS
>>> pd.cut(day1.Age,[18,24,34,44,54,64,],right=False)[:30] #<-- THIS DOES NOT?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'cut'
>>> pd
<module 'pandas' from '/usr/lib/pymodules/python2.7/pandas/__init__.pyc'>
>>> pd.__version__
'0.7.0'
编辑:包括熊猫的版本。