Skip to content

Commit

Permalink
code sample for pandas-dev#42390
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins committed Jul 28, 2021
1 parent 4abfff5 commit 4b8e09a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions bisect/42390.py
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)

0 comments on commit 4b8e09a

Please sign in to comment.