We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import pandas as pd import scipy as sp
df = pd.DataFrame(sp.randn(5,2)) ts = df[0]
df.diff(0)
Out[43]: 0 1 0 0 0 1 0 0 2 0 0 3 0 0 4 0 0
ts.diff(0)
ValueError Traceback (most recent call last)
/home/jzunigavu/workspace/hf_vol_data/predictor_curves/ in ()
/home/jzunigavu/.local/lib/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/core/series.pyc in diff(self, periods) 1736 diffed : Series 1737 """ -> 1738 result = com.diff(self.values, periods) 1739 return Series(result, self.index, name=self.name) 1740
/home/jzunigavu/.local/lib/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/core/common.pyc in diff(arr, n, axis) 489 lag_indexer = tuple(lag_indexer) 490 --> 491 out_arr[res_indexer] = arr[res_indexer] - arr[lag_indexer] 492 493 return out_arr
ValueError: operands could not be broadcast together with shapes (5) (0)
The text was updated successfully, but these errors were encountered:
BUG: Series diff(0) fails #3257
bc696a7
@changhiskhan close this?
Sorry, something went wrong.
yes please On Apr 7, 2013 7:37 AM, "jreback" [email protected] wrote:
@changhiskhan https://github.com/changhiskhan close this? — Reply to this email directly or view it on GitHubhttps://github.com//issues/3257#issuecomment-16013596 .
@changhiskhan https://github.com/changhiskhan close this?
— Reply to this email directly or view it on GitHubhttps://github.com//issues/3257#issuecomment-16013596 .
No branches or pull requests
import pandas as pd
import scipy as sp
df = pd.DataFrame(sp.randn(5,2))
ts = df[0]
If you run:
df.diff(0)
Out[43]:
0 1
0 0 0
1 0 0
2 0 0
3 0 0
4 0 0
This works as expeted but if you run
ts.diff(0)
:ValueError Traceback (most recent call last)
/home/jzunigavu/workspace/hf_vol_data/predictor_curves/ in ()
/home/jzunigavu/.local/lib/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/core/series.pyc in diff(self, periods)
1736 diffed : Series
1737 """
-> 1738 result = com.diff(self.values, periods)
1739 return Series(result, self.index, name=self.name)
1740
/home/jzunigavu/.local/lib/python2.7/site-packages/pandas-0.10.1-py2.7-linux-x86_64.egg/pandas/core/common.pyc in diff(arr, n, axis)
489 lag_indexer = tuple(lag_indexer)
490
--> 491 out_arr[res_indexer] = arr[res_indexer] - arr[lag_indexer]
492
493 return out_arr
ValueError: operands could not be broadcast together with shapes (5) (0)
The text was updated successfully, but these errors were encountered: