Skip to content

Conversation

@jbrockmendel
Copy link
Member

Sits on top of #44581

@jbrockmendel jbrockmendel changed the title Bug mode BUG: Series.mode with dt64tz or PeriodDtype Nov 22, 2021
@jreback jreback added this to the 1.4 milestone Nov 25, 2021
@jreback jreback added Bug Timezones Timezone data dtype labels Nov 25, 2021
# type, _SupportsDType, str, Union[Tuple[Any, int], Tuple[Any, Union[int,
# Sequence[int]]], List[Any], _DTypeDict, Tuple[Any, Any]]]"
return self._ndarray.view(dtype=dtype) # type: ignore[return-value,arg-type]
return super().view(dtype)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove this entirely (since it will just user the super view anyhow)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not with the @overloads just above this

assert res.dtype == ser.dtype
tm.assert_series_equal(res, ser)

res = pd.core.algorithms.mode(ser._values)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we have a rule which prevents this? e.g. can you import at the top instead

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about the rule. will move the import

@jreback
Copy link
Contributor

jreback commented Nov 26, 2021

i ithink this needs a rebase as merged the underlying PR

@jbrockmendel
Copy link
Member Author

Rebased +greenish

@jreback jreback merged commit 014ea2e into pandas-dev:master Nov 26, 2021
@jbrockmendel jbrockmendel deleted the bug-mode branch November 26, 2021 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Timezones Timezone data dtype

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Timezones are not preserved in Series.mode() output

2 participants