Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Pandas 0.23.4 TypeError: Already tz-aware #671

Closed
fl4p-old opened this issue Jan 7, 2019 · 7 comments · Fixed by #684
Closed

Pandas 0.23.4 TypeError: Already tz-aware #671

fl4p-old opened this issue Jan 7, 2019 · 7 comments · Fixed by #684

Comments

@fl4p-old
Copy link

fl4p-old commented Jan 7, 2019

The UTC tz localization raises a TypeError: Already tz-aware, use tz_convert to convert. with pandas 0.23.4 .

I think this a suitable fix:

            if df.index.tzinfo is None:
                df.index = df.index.tz_localize('UTC')
@grainednoise
Copy link

I ran into the same problem. The proposed fix solves the problem for me.

@nathanielatom
Copy link
Contributor

Any ETA on when this fix will be merged and released?

@lovasoa
Copy link
Contributor

lovasoa commented Feb 19, 2019

I got the same problem. Is something preventing the PR from being merged ?

File "/lib/python2.7/site-packages/influxdb/_dataframe_client.py", line 185, in query
return self._to_dataframe(results, dropna)
File "/lib/python2.7/site-packages/influxdb/_dataframe_client.py", line 205, in _to_dataframe
df.index = df.index.tz_localize('UTC')
File "/lib/python2.7/site-packages/pandas/core/accessor.py", line 91, in f
return self._delegate_method(name, *args, **kwargs)
File "/lib/python2.7/site-packages/pandas/core/indexes/datetimelike.py", line 721, in _delegate_method
result = operator.methodcaller(name, *args, **kwargs)(self._data)
File "/lib/python2.7/site-packages/pandas/core/arrays/datetimes.py", line 1049, in tz_localize
raise TypeError("Already tz-aware, use tz_convert to convert.")
TypeError: Already tz-aware, use tz_convert to convert.

@AlnsV
Copy link

AlnsV commented Feb 24, 2019

This solves the problem, happening to me just now...

@freshwuzhere
Copy link

Me too :-(

@lovasoa
Copy link
Contributor

lovasoa commented Mar 1, 2019

#679 fixes this. @xginn8 should merge it soon

@clslgrnc
Copy link
Contributor

Should be solved in 5.2.2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants