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

Series.hasnans shouldn't be cached #19700

Closed
jbrockmendel opened this issue Feb 14, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@jbrockmendel
Copy link
Member

commented Feb 14, 2018

Series.hasnans is as a cache_readonly inherited from IndexOpsMixin

ser = pd.Series([0, 1.0])
>>> ser.hasnans
False
ser.iloc[0] = np.nan
>>> ser.hasnans
False
@TomAugspurger

This comment has been minimized.

Copy link
Contributor

commented Feb 14, 2018

I wonder if that's intended to be Index only? Might want to just deprecate it in favor of .isna().any().

@jbrockmendel

This comment has been minimized.

Copy link
Member Author

commented Feb 14, 2018

I was thinking of adding an _immutable flag to Index/NDFrame(/Array) and a decorator cache_if_immutable that acts like cache_readonly for if obj._immutable and like property otherwise. There's a bunch of stuff (in datetimes/timedeltas/periods, where else) like this that could make use of it.

jbrockmendel added a commit to jbrockmendel/pandas that referenced this issue Jul 11, 2018

@jbrockmendel jbrockmendel referenced this issue Jul 11, 2018

Merged

CLN: miscellaneous cleanups / fixes #21861

3 of 3 tasks complete

@jreback jreback added this to the 0.24.0 milestone Jul 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.