TypeError casting int64 to int32 when shifting time series · Issue #8129 · pandas-dev/pandas (original) (raw)
I think I hit another 32bits issue. This happens in Win7 32 bits:
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> index = pd.date_range('2000-01-01', periods=5, freq='D')
>>> s1 = pd.Series(range(5), index=index)
>>> p = s1.iloc[1]
>>> s1.shift(periods=p)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Python27\lib\site-packages\pandas\core\generic.py", line 3290, in shift
new_data = self._data.shift(periods=periods, axis=block_axis)
File "D:\Python27\lib\site-packages\pandas\core\internals.py", line 2228, in shift
return self.apply('shift', **kwargs)
File "D:\Python27\lib\site-packages\pandas\core\internals.py", line 2192, in apply
applied = getattr(b, f)(**kwargs)
File "D:\Python27\lib\site-packages\pandas\core\internals.py", line 791, in shift
new_values = np.roll(new_values, periods, axis=axis)
File "D:\Python27\lib\site-packages\numpy\core\numeric.py", line 1294, in roll
res = a.take(indexes, axis)
TypeError: Cannot cast array data from dtype('int64') to dtype('int32') according to the rule 'safe'
>>> pd.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.6.final.0
python-bits: 32
OS: Windows
OS-release: 7
machine: x86
processor: x86 Family 6 Model 58 Stepping 9, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
pandas: 0.14.1
nose: 1.3.3
Cython: None
numpy: 1.8.1
scipy: 0.14.0
statsmodels: 0.5.0
IPython: 2.2.0
sphinx: 1.2.2
patsy: 0.2.1
scikits.timeseries: None
dateutil: 2.2
pytz: 2014.3
bottleneck: 0.8.0
tables: 3.1.1
numexpr: 2.4
matplotlib: 1.4.0
openpyxl: None
xlrd: 0.9.3
xlwt: 0.7.5
xlsxwriter: None
lxml: 3.3.5
bs4: 4.3.2
html5lib: 0.999
httplib2: None
apiclient: None
rpy2: None
sqlalchemy: 0.9.4
pymysql: None
psycopg2: None