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 found the resample for subsampling to aggregate would take NaN(np.nan) as zero.
I have seen the similar question in Handling NaN during resampling #22065
I use .sum(), .sum(skipna=False), .apply(np.sum), and my function .apply(lambda x: np.sum(x.values) to test the same series. Only my function work out with my expected result.
mroeschke
changed the title
resample using for subsample will regards NaN as zeros
resample using for subsample will regards NaN as zeros with sum
May 11, 2020
I can confirm that this bug is still present in pandas: v1.3.4, and effects other aggregation functions such as .max and .mean when used in combination with .resample.
Problem description
I found the
resample
for subsampling to aggregate would take NaN(np.nan
) as zero.I have seen the similar question in Handling NaN during resampling #22065
I use
.sum()
,.sum(skipna=False)
,.apply(np.sum)
, and my function.apply(lambda x: np.sum(x.values)
to test the same series. Only my function work out with my expected result.my environment
numpy: 1.16.5
pandas: 0.25.1
1 using
.sum()
2 using
.sum(skipna=False)
will raise an error3 using
.apply(np.sum)
4 using
.apply(lambda x: np.sum(x.values))
The text was updated successfully, but these errors were encountered: