Skip to content

BUG-24915 fix unhashble Series.name in df aggregation #24920

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

Closed
wants to merge 1 commit into from
Closed
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
10 changes: 5 additions & 5 deletions pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

from pandas.core.dtypes.common import (
is_datetime64_ns_dtype, is_datetime64tz_dtype, is_datetimelike,
is_extension_array_dtype, is_extension_type, is_list_like, is_object_dtype,
is_scalar, is_timedelta64_ns_dtype)
is_extension_array_dtype, is_extension_type, is_hashable, is_list_like,
is_object_dtype, is_scalar, is_timedelta64_ns_dtype)
from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCSeries
from pandas.core.dtypes.missing import isna

Expand Down Expand Up @@ -546,10 +546,10 @@ def is_any_frame():
try:
result = DataFrame(result)
except ValueError:

name_attr = getattr(self, 'name', None)
name_attr = name_attr if is_hashable(name_attr) else None
# we have a dict of scalars
result = Series(result,
name=getattr(self, 'name', None))
result = Series(result, name=name_attr)

return result, True
elif is_list_like(arg) and arg not in compat.string_types:
Expand Down