# Convert JSON to CSV in Python # Python program to convert# JSON file to CSVimport jsonimport csv# Opening JSON file and loading the data# into the variable datawith open('data.json') as json_file:    data = json.load(json_file)employee_data = data['emp_details']# now we will open a file for writingdata_file = open('data_file.csv', 'w')# create the csv writer objectcsv_writer = csv.writer(data_file)# Counter variable used for writing# headers to the CSV filecount = 0for emp in employee_data:    if count == 0:        # Writing headers of CSV file        header = emp.keys()        csv_writer.writerow(header)        count += 1    # Writing data of CSV file    csv_writer.writerow(emp.values())data_file.close()