Skip to content
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

Tz-aware datetime.datetime cannot be converted to datetime64 unless utc=True #6

Open
DeshanLokuge opened this issue May 21, 2019 · 0 comments

Comments

@DeshanLokuge
Copy link

I tied to run the following query using the fred api:
params = {'limit': 100, 'tag_names': 'daily'}
res = fr.tag.series('daily', params = params)

The objective was to get the set economic data series as a datafrane where the frequency of the data was 'daily'

But it gave an error as follows:

**ValueError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/pandas/core/arrays/datetimes.py in objects_to_datetime64ns(data, dayfirst, yearfirst, utc, errors, require_iso8601, allow_object)
1860 try:
-> 1861 values, tz_parsed = conversion.datetime_to_datetime64(data)
1862 # If tzaware, these values represent unix timestamps, so we

pandas/_libs/tslibs/conversion.pyx in pandas._libs.tslibs.conversion.datetime_to_datetime64()

ValueError: Array must be all same time zone

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last)
16 frames
/usr/local/lib/python3.6/dist-packages/pandas/core/arrays/datetimes.py in objects_to_datetime64ns(data, dayfirst, yearfirst, utc, errors, require_iso8601, allow_object)
1855 dayfirst=dayfirst,
1856 yearfirst=yearfirst,
-> 1857 require_iso8601=require_iso8601
1858 )
1859 except ValueError as e:

pandas/_libs/tslib.pyx in pandas._libs.tslib.array_to_datetime()

pandas/_libs/tslib.pyx in pandas._libs.tslib.array_to_datetime()

ValueError: Tz-aware datetime.datetime cannot be converted to datetime64 unless utc=True**

I am doubting whether this is a pandas issue or something else.
I would appreciate a fix for this issue or any directions to get the afore mentioned data series of interest.

Thank you in advance,
Kind Regards,
Deshan Lokuge

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

No branches or pull requests

1 participant