You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was playing with axis 0 and 1 in DataFrame shift. I get the following error:
import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.rand(10,5))
df.shift(1,axis=1)
This gives me an error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\WinPython-32bit-2.7.6.3\python-2.7.6\lib\site-packages\pandas\core\generic.py", line 3175, in shift
new_data = self._data.shift(indexer, periods, axis=block_axis)
File "c:\WinPython-32bit-2.7.6.3\python-2.7.6\lib\site-packages\pandas\core\internals.py", line 2407, in shift
return self.apply('shift', *args, **kwargs)
File "c:\WinPython-32bit-2.7.6.3\python-2.7.6\lib\site-packages\pandas\core\internals.py", line 2375, in apply
applied = getattr(blk, f)(*args, **kwargs)
File "c:\WinPython-32bit-2.7.6.3\python-2.7.6\lib\site-packages\pandas\core\internals.py", line 918, in shift
new_values = self.values.take(indexer, axis=axis)
IndexError: index 5 is out of bounds for size 5
I am using pandas 0.13.1
The text was updated successfully, but these errors were encountered:
I was playing with axis 0 and 1 in DataFrame shift. I get the following error:
This gives me an error:
I am using pandas 0.13.1
The text was updated successfully, but these errors were encountered: