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

[BUG] cannot import name 'json_normalize' from 'pandas.io.json' #432

Open
ghabxph opened this issue Jul 14, 2024 · 2 comments
Open

[BUG] cannot import name 'json_normalize' from 'pandas.io.json' #432

ghabxph opened this issue Jul 14, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ghabxph
Copy link

ghabxph commented Jul 14, 2024

Problem description

Just followed the snippet from the main page

Example

from fastquant import get_crypto_data
crypto = get_crypto_data("BTC/USDT", "2022-01-01", "2024-07-14")
crypto.head()

Expected behavior

I should see market data like this:

#             open    high     low     close    volume
# dt                                                          
# 2018-12-01  4041.27  4299.99  3963.01  4190.02  44840.073481
# 2018-12-02  4190.98  4312.99  4103.04  4161.01  38912.154790
# 2018-12-03  4160.55  4179.00  3827.00  3884.01  49094.369163
# 2018-12-04  3884.76  4085.00  3781.00  3951.64  48489.551613
# 2018-12-05  3950.98  3970.00  3745.00  3769.84  44004.799448

Actual behavior

image

Environment

  • platform OSX:
  • fastquant version: fastquant==0.1.8.1
  • installation method: pip
@ghabxph ghabxph added the bug Something isn't working label Jul 14, 2024
@wyt3721
Copy link

wyt3721 commented Jul 17, 2024

maybe u can revise 'from pandas.io.json import json_normalize ' to 'from pandas.io.json import _normalize' . I check pandas.io.json and only find _normalize.py , there is no json_normalize.py .
in fact ,pandas.io.json.json_normalize is deprecated after pandas 1.0.0, use pandas.json_normalize instead.

@feree999
Copy link

I had the exact same error. I'm a very novice programmer so I tried a very simple (and may not the best) solution but it worked: I duplicated and renamed the _normalize file to json_normalize in the ...\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\io\json folder. This way I have both _normalize and json_normalize.
If you have a more professional fix please share!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants