18

I am exploring the Jupiter notebook for Python. While calling this method "Access OutbreakLocation data" I get this exception in Python 3.6: getting AttributeError: module 'pandas' has no attribute 'json_normalize'

Any ideas how can we fix this issue?

5 Answers 5

20

I too had this error, the solution is load pandas of the following way:

from pandas.io.json import json_normalize

This is due to version change of the pandas library.

Sign up to request clarification or add additional context in comments.

1 Comment

to do the change of pandas 0.24 a 1.0.3. It don´t was the solution for me
16

Make sure to update to Pandas 1.0.3. Pandas prior to version 1 doesn't have json_normalize.

Comments

5
!pip install --user pandas==1.0.3
import pandas as pd
pd.__version__

ibm studio was running a pandas version 0.24. By using above commands it was upgraded to version 1.0.3

Comments

0

for newer versions of pandas >= 1.0.3 importing the json_normalize from pandas.io.json works well and it doesn't throw the error of missing attribute

from pandas.io.json import json_normalize
 
data = [{"name": "Alice", "age": 30, "city": "New York"},
    {"name": "Bob", "age": 25, "city": "Los Angeles"},
    {"name": "Charlie", "age": 40, "city": "Chicago"},]
json = json_normalize(data)

Comments

0

There is an updated information about the json_normalize (in short, use pandas.json_normalize) in the following thread.

ImportError: cannot import name 'json_normalize' from 'pandas.io.json'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.