Skip to content

Commit ffeab75

Browse files
committed
address comments
1 parent d4a8046 commit ffeab75

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

doc/source/whatsnew/v2.0.0.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,8 +1371,7 @@ Groupby/resample/rolling
13711371
- Bug in :meth:`.DataFrameGroupBy.agg` with ``engine="numba"`` failing to respect ``as_index=False`` (:issue:`51228`)
13721372
- Bug in :meth:`DataFrameGroupBy.agg`, :meth:`SeriesGroupBy.agg`, and :meth:`Resampler.agg` would ignore arguments when passed a list of functions (:issue:`50863`)
13731373
- Bug in :meth:`DataFrameGroupBy.ohlc` ignoring ``as_index=False`` (:issue:`51413`)
1374-
- Bug in :meth:`BaseGrouper.groups` when grouping by datetime, zip() was using :meth:`BaseGrouper.__iter__` that produced incorrect result in case of :class:`BinGrouper`. Fixed by adding :meth:`BinGrouper.__iter__` that returns correct iterable (:issue:`51158`)
1375-
-
1374+
- Bug in :meth:`GroupBy.groups` with a datetime key in conjunction with another key produced incorrect number of group keys (:issue:`51158`)
13761375

13771376
Reshaping
13781377
^^^^^^^^^

pandas/tests/groupby/test_grouping.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def test_groupby_with_datetime_key(self):
451451
}
452452
)
453453
grouper = Grouper(key="b", freq="D")
454-
g = df.groupby([grouper, "id"])
454+
gb = df.groupby([grouper, "id"])
455455

456456
# test number of groups
457457
expected = {
@@ -460,10 +460,10 @@ def test_groupby_with_datetime_key(self):
460460
(Timestamp("2000-01-02"), "a"): [4],
461461
(Timestamp("2000-01-02"), "b"): [3, 5],
462462
}
463-
tm.assert_dict_equal(g.groups, expected)
463+
tm.assert_dict_equal(gb.groups, expected)
464464

465465
# test number of group keys
466-
tm.assert_equal(len(g.groups.keys()), 4)
466+
assert len(gb.groups.keys()) == 4
467467

468468
def test_grouping_error_on_multidim_input(self, df):
469469
msg = "Grouper for '<class 'pandas.core.frame.DataFrame'>' not 1-dimensional"

0 commit comments

Comments
 (0)