Skip to content

Commit 0958b54

Browse files
committed
test
1 parent 0b920f0 commit 0958b54

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

pint_pandas/testsuite/test_issues.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,20 @@ def test_issue285(self):
374374
periods=5,
375375
freq="5min"
376376
)
377+
378+
379+
values = np.random.uniform(low=0, high=200, size=len(time_index))
380+
value_series = pd.Series(
381+
values,
382+
index=time_index,
383+
)
384+
385+
# Attempt to resample and reduce
386+
resampled = value_series.resample('h')
387+
mean_expected = pd.Series(resampled.mean(), dtype=PintType("kg"))
388+
std_expected = pd.Series(resampled.std(), dtype=PintType("kg"))
389+
390+
377391
values = np.random.uniform(low=0, high=200, size=len(time_index))
378392
value_series = pd.Series(
379393
values,
@@ -383,5 +397,8 @@ def test_issue285(self):
383397

384398
# Attempt to resample and reduce
385399
resampled = value_series.resample('h')
386-
mean = resampled.mean() # < --- Works
387-
std = resampled.std() # <--- Blows up with NotImplementedError
400+
mean_kg = resampled.mean() # < --- Works
401+
std_kg = resampled.std() # <--- Blows up with NotImplementedError
402+
403+
tm.assert_equal(mean_kg, mean_expected)
404+
tm.assert_equal(std_kg, std_expected)

0 commit comments

Comments
 (0)