-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
CLN: Single way to get underlying values for Index / Series #19548
Comments
So currently it seems that Wondering if we can't just use |
(edited the original post to note the differences) Also In [6]: pd.DatetimeIndex(['2017'], tz="US/Central")._values
Out[6]: array(['2017-01-01T06:00:00.000000000'], dtype='datetime64[ns]')
In [7]: pd.Series(pd.DatetimeIndex(['2017'], tz="US/Central"))._values
Out[7]: DatetimeIndex(['2017-01-01 00:00:00-06:00'], dtype='datetime64[ns, US/Central]', freq=None) |
When I looked at changing The more difficult thing was in the indexing engines. Those really do need an ndarray of integers (or whatever). So we need both |
On naming, we want something that conveys "This is the best / fullest-information array representation." i.e. we aren't going to drop the TZ and convert to UTC. |
Ah yes that one for sure as well, I was only looking at Index.values vs Index._values (with the idea, if it is almost always the same, we could use I think names like |
Ah, I like So how about |
Although implementation-wise, it may be easier to
I may start with that. |
Yep, that might be easier for now (to go forward on the other PR). Although it will not decrease the complexity .. :-) |
+1 See also #19294. Some of the accessors have |
(split from #19520)
It'd be convenient to have an internal method for getting the highest-fidelity array stored by a container (Index, Series, Block?).
For
Series
, this is already what._values
does.Index._values
is sometimes different though (Period, DatetimeIndex with TZ), so we'll use a different name.The text was updated successfully, but these errors were encountered: