FutureWarning: Converting Timezone-aware DatetimeArray To Timezone-naive Ndarray With 'datetime64[ns]' Dtype
I upgraded from pandas 0.20.3 to pandas 0.24.1. While running the command ts.sort_index(inplace=True), I am getting a FutureWarning in my test output, which is shown below. Can I c
Solution 1:
I rewrote your question here, to include an MCVE. After it went a while with no responses, I posted an issue against Pandas.
Here's my workaround:
with warnings.catch_warnings():
# Bug in Pandas emits useless warning when sorting tz-aware index
warnings.simplefilter("ignore")
ds = df.sort_index()
Solution 2:
If I were you, I would do a downgrade using pip and setting the previous version. It's the lazier answer. But if you really want to keep it upgraded, then there is a parameter call deprecated warning inside pandas data frame. Just adjust it accordingly what you need. You can check it using the documentation of pandas. Have a nice night
Post a Comment for "FutureWarning: Converting Timezone-aware DatetimeArray To Timezone-naive Ndarray With 'datetime64[ns]' Dtype"