I have .json file which have this type of data ,the name of universities of the world
[
{
"web_pages": [
"https://www.cstj.qc.ca",
"https://ccmt.cstj.qc.ca",
"https://ccml.cstj.qc.ca"
],
"name": "Cégep de Saint-Jérôme",
"alpha_two_code": "CA",
"state-province": null,
"domains": [
"cstj.qc.ca"
],
"country": "Canada"
},
{
"web_pages": [
"http://www.lindenwood.edu/"
],
"name": "Lindenwood University",
"alpha_two_code": "US",
"state-province": null,
"domains": [
"lindenwood.edu"
],
"country": "United States"
},
{
"web_pages": [
.......
.....
....
...
Continue......
I want to convert this .json file into CSV using Python, What will be its solution to make the CSV file?
import json from pandas.io.json import json_normalize with open('infile.json') as json_data: d = json.load(json_data) df = json_normalize(d) df.to_csv('outfile.csv', index=False)