Skip to content

Commit e42a060

Browse files
committed
Address review comments
1 parent 87c803b commit e42a060

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Other enhancements
5555
- :meth:`Series.plot` now correctly handle the ``ylabel`` parameter for pie charts, allowing for explicit control over the y-axis label (:issue:`58239`)
5656
- :meth:`DataFrame.plot.scatter` argument ``c`` now accepts a column of strings, where rows with the same string are colored identically (:issue:`16827` and :issue:`16485`)
5757
- :func:`read_parquet` accepts ``to_pandas_kwargs`` which are forwarded to :meth:`pyarrow.Table.to_pandas` which enables passing additional keywords to customize the conversion to pandas, such as ``maps_as_pydicts`` to read the Parquet map data type as python dictionaries (:issue:`56842`)
58+
- :meth:`.DataFrameGroupBy.transform`, :meth:`.SeriesGroupBy.transform`, :meth:`.DataFrameGroupBy.agg`, :meth:`.SeriesGroupBy.agg`, :meth:`.SeriesGroupBy.apply`, :meth:`.DataFrameGroupBy.apply` now support ``kurt`` (:issue:`40139`)
5859
- :meth:`DataFrameGroupBy.transform`, :meth:`SeriesGroupBy.transform`, :meth:`DataFrameGroupBy.agg`, :meth:`SeriesGroupBy.agg`, :meth:`RollingGroupby.apply`, :meth:`ExpandingGroupby.apply`, :meth:`Rolling.apply`, :meth:`Expanding.apply`, :meth:`DataFrame.apply` with ``engine="numba"`` now supports positional arguments passed as kwargs (:issue:`58995`)
59-
- :meth:`DataFrameGroupBy.transform`, :meth:`SeriesGroupBy.transform`, :meth:`DataFrameGroupBy.agg`, :meth:`SeriesGroupBy.agg`, :meth:`SeriesGroupBy.apply`, :meth:`DataFrame.apply` now support ``kurt`` (:issue:`40139`)
6060
- :meth:`Rolling.agg`, :meth:`Expanding.agg` and :meth:`ExponentialMovingWindow.agg` now accept :class:`NamedAgg` aggregations through ``**kwargs`` (:issue:`28333`)
6161
- :meth:`Series.map` can now accept kwargs to pass on to func (:issue:`59814`)
6262
- :meth:`pandas.concat` will raise a ``ValueError`` when ``ignore_index=True`` and ``keys`` is not ``None`` (:issue:`59274`)

pandas/tests/groupby/methods/test_kurt.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import numpy as np
2+
import pytest
23

34
import pandas.util._test_decorators as td
45

@@ -30,23 +31,27 @@ def test_groupby_kurt_equivalence():
3031
tm.assert_frame_equal(result, expected)
3132

3233

33-
@td.skip_if_no("pyarrow")
34-
def test_groupby_kurt_arrow_float64():
34+
@pytest.mark.parametrize(
35+
"dtype",
36+
[
37+
pytest.param("float64[pyarrow]", marks=td.skip_if_no("pyarrow")),
38+
"Float64",
39+
],
40+
)
41+
def test_groupby_kurt_arrow_float64(dtype):
3542
# GH#40139
36-
# Test groupby.kurt() with float64[pyarrow] dtype
43+
# Test groupby.kurt() with float64[pyarrow] and Float64 dtypes
3744
df = pd.DataFrame(
3845
{
3946
"x": [1.0, np.nan, 3.2, 4.8, 2.3, 1.9, 8.9],
4047
"y": [1.6, 3.3, 3.2, 6.8, 1.3, 2.9, 9.0],
4148
},
42-
dtype="float64[pyarrow]",
49+
dtype=dtype,
4350
)
4451
gb = df.groupby(by=lambda x: 0)
4552

4653
result = gb.kurt()
47-
expected = pd.DataFrame(
48-
{"x": [2.1644713], "y": [0.1513969]}, dtype="float64[pyarrow]"
49-
)
54+
expected = pd.DataFrame({"x": [2.1644713], "y": [0.1513969]}, dtype=dtype)
5055
tm.assert_almost_equal(result, expected)
5156

5257

0 commit comments

Comments
 (0)