![]() So, here I did got my answer but instead of printing it once, It is printing 7 times. My goal is to get a csv with all the columns inside the json, and to do this I have to create single columns for each nested index inside the JSON. ![]() Output userID,Is salary credited before 5th,Avg Salary of last 3 months,Avg Salary of last 6 months,Avg Balance before salary of last 3 months,Avg Balance before salary of last 6 monthsĦ79d3bad-155e-4b39-9ff7-7d564f408942,Yes,15453.33,15290.5,113.15,105.22 apathak092 Read Discuss Courses Practice In this article, we will discuss how can we convert nested JSON to CSV in Python. How to convert nested JSON data to CSV with separate columns for each nested index Asked today Modified today Viewed 4 times 0 I have a nested json output from an API request. How can I convert JSON to CSV Open a file for writing Create the csv writer object Make sure to close the file in order to save the contents Subscribe to. Following is my json file input Ĭode with open('/Users/vrindabv/Documents/PycharmProjects/BankStatementEngine/test.json', "r") as f:į = csv.writer(open("/Users/vrindabv/Documents/PycharmProjects/BankStatementEngine/test.csv", "w"))į.writerow()į.writerow(, x, ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |