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 have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the master branch of pandas.
Reproducible Example
importpandasaspdimportnumpyasnp# w = np.array([2,3])[0] # normal use w=np.int64(2)
pd.Series([1,2,3]).diff(w) # workspd.DataFrame([1,2,3]).diff(w) # fails
Issue Description
When diff method is called with a np.int64 then ValueError is raised as np.int64 is not instance of int (see numpy/numpy#2951 (comment)). Also, this behavior is not consistent between Series and DataFrame.
asdf8601
changed the title
BUG: diff method raise ValueError when it's called with np.int64
BUG: diff method raises ValueError when it's called with np.int64
Nov 22, 2021
Thank you @jbrockmendel, Have you been faster than me ;-)
I could see that the fix will be included in 1.4. So, I'm wondering if you are planning to populate it to other releases apart from 1.4 as bug fix or not. What is the rule?
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the master branch of pandas.
Reproducible Example
Issue Description
When
diff
method is called with anp.int64
thenValueError
is raised asnp.int64
is not instance ofint
(see numpy/numpy#2951 (comment)). Also, this behavior is not consistent betweenSeries
andDataFrame
.Expected Behavior
I've expected
DataFrame
work likeSeries
does.Installed Versions
The text was updated successfully, but these errors were encountered: