forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4abfff5
commit 4b8e09a
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# BUG: Regression on SeriesGrouper using Timestamp index with pandas 1.3.0 #42390 | ||
|
||
import numpy as np | ||
import pandas as pd | ||
|
||
print(pd.__version__) | ||
|
||
def agg(series): | ||
if series.isna().values.all(): | ||
return None | ||
return np.sum(series) | ||
|
||
|
||
df = pd.DataFrame([1.0], index=[pd.Timestamp("2018-01-16 00:00:00+00:00")]) | ||
|
||
result = df.groupby(lambda x: 1).agg(agg) | ||
print(result) | ||
|
||
expected = pd.DataFrame([1.0], index=[1]) | ||
pd.testing.assert_frame_equal(result, expected) | ||
|