Skip to content

Commit 034a0e9

Browse files
committed
removed redundant comment, added issue number, updated doc
1 parent 8405f65 commit 034a0e9

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ Plotting
652652
Groupby/resample/rolling
653653
^^^^^^^^^^^^^^^^^^^^^^^^
654654
- Bug in :meth:`.DataFrameGroupBy.__len__` and :meth:`.SeriesGroupBy.__len__` would raise when the grouping contained NA values and ``dropna=False`` (:issue:`58644`)
655+
- Bug in :meth:`.DataFrameGroupBy.any` that returned True for groups where all Timedelta values are NaT. (:issue:`59782`)
655656
- Bug in :meth:`.DataFrameGroupBy.groups` and :meth:`.SeriesGroupby.groups` that would not respect groupby argument ``dropna`` (:issue:`55919`)
656657
- Bug in :meth:`.DataFrameGroupBy.median` where nat values gave an incorrect result. (:issue:`57926`)
657658
- Bug in :meth:`.DataFrameGroupBy.quantile` when ``interpolation="nearest"`` is inconsistent with :meth:`DataFrame.quantile` (:issue:`47942`)

pandas/tests/groupby/test_grouping.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,15 +1183,12 @@ def test_grouping_by_key_is_in_axis():
11831183

11841184

11851185
def test_groupby_any_with_timedelta():
1186-
# Create a DataFrame with a single column containing a Timedelta and NaT
1186+
# GH#59712
11871187
df = DataFrame({"value": [pd.Timedelta(1), pd.NaT]})
11881188

1189-
# Perform groupby().any() operation
11901189
result = df.groupby(np.array([0, 1], dtype=np.int64))["value"].any()
11911190

1192-
# Expected result: group with NaT should return False
11931191
expected = Series({0: True, 1: False}, name="value", dtype=bool)
11941192
expected.index = expected.index.astype(np.int64)
11951193

1196-
# Check if the result matches the expected output
11971194
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)