Getting attribute error : module 'pandas' has no attribute 'json_normalize'

I was trying to use json_normalize function to flatten the JSON data. While calling the function I am getting this exception in Python;

AttributeError: module 'pandas' has no attribute 'json_normalize' 

I'm using Python 3.8-Azure ML and used this;

from pandas.io.json import json_normalize 

How can we import this?

2 Answers

Try to

from pandas import json_normalize 

json_normalize is coming from pandas directly

So what you have to import is:

from pandas import json_normalize 
9

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like