-3

How can I convert this json into dataframe in python, by removing fields. I just need employess data in my dataframe.

{'fields': [{'id': 'displayName', 'type': 'text', 'name': 'Display name'}, 
{'id': 'firstName', 'type': 'text', 'name': 'First name'}, 
{'id': 'gender', 'type': 'gender', 'name': 'Gender'}], 

'employees': [{'id': '123', 'displayName': 'abc', 'firstName': 'abc','gender': 'Female'}, 
{'id': '234', 'displayName': 'xyz.', 'firstName': 'xyz','gender': 'Female'}, 
{'id': '345', 'displayName': 'pqr', 'firstName': 'pqr', 'gender': 'Female'}]}
  • Hello and welcome to StackOverflow. Please take some time to read the help page, especially the sections named ["What topics can I ask about here?"](http://stackoverflow.com/help/on-topic) and ["What types of questions should I avoid asking?"](http://stackoverflow.com/help/dont-ask). And more importantly, please read [the Stack Overflow question checklist](http://meta.stackexchange.com/q/156810/204922). You might also want to learn about [Minimal, Complete, and Verifiable Examples](http://stackoverflow.com/help/mcve). – Edeki Okoh Feb 07 '19 at 18:02

1 Answers1

0

If you wan the employee information you can

   JSON = {var:[...],'employees':[{}]}
   employee_info = JSON['employees']

employee_info with be a list of dictionaries which you will be able to create a dataframe from by this answer: Convert list of dictionaries to a pandas DataFrame

Tiblit
  • 151
  • 4