The original deprecation happened in #38544
This comment is from #22384 (comment), moving it here to a separate issue.
But, on the specific datetime -> integer deprecation:
astype
, but then point people to the view
instead. There are usecases where you need the integers (eg if you want to do some custom rounding, or need to feed it to a system that requires unix time as integers, ...), and personally I would rather have users go to astype
than view
(because astype
is the more standard method for this, + if we would go with copy-on-write, this gets a bit a strange method ...)view
will actually error for non-equal size bitwidth (astype
actually as well, but that's something we can change, while for view
that is inherent to the method). And view
can also silently overflow if converting to uint64, while for astype
we could check for that. In general, I see view
as an advanced method you should only use if you really know what you are doing (and in general you don't really need in pandas, I think)There is then some follow-up discussion in the issue below #22384 (comment)
I would personally propose to keep allowing astype()
for datetime64 -> int64, and not steer users to view()
for this.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4