It would be nice if the tz_localize
function of a DatetimeIndex
had an optional flag for silently returning NaT
instead of throwing a NonExistentTimeError
, if the timestamp is not valid in the given timezone (for example due to DST changes).
I ran into this problem while trying to tz_localize
a large index, and it seems to me that this would be a much better solution than manually handling the exception with a lambda expression in a (slow) python loop.
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