Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support kurt/skew(axis=None) for multi columns/low row count #14874

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
is_string_dtype,
)
from cudf.core import column, df_protocol, indexing_utils, reshape
from cudf.core._compat import PANDAS_GE_200
from cudf.core.abc import Serializable
from cudf.core.column import (
CategoricalColumn,
Expand Down Expand Up @@ -95,11 +96,8 @@
min_scalar_type,
numeric_normalize_types,
)

from cudf.utils.nvtx_annotation import _cudf_nvtx_annotate
from cudf.utils.utils import GetAttrGetItemMixin, _external_only_api
from cudf.core._compat import PANDAS_GE_200


_cupy_nan_methods_map = {
"min": "nanmin",
Expand Down Expand Up @@ -6112,8 +6110,13 @@ def _reduce(
if axis == 0
else source.index
)

if axis in {0, 2}:
if axis == 2 and op in ("kurtosis", "kurt", "skew"):
# TODO: concat + op can probably be done in the general case
# for axis == 2.
return getattr(concat_columns(source._data.columns), op)(
**kwargs
)
try:
result = [
getattr(source._data[col], op)(**kwargs)
Expand Down
Loading