문제

While converting json file to csv,I got the above error My code is shown below:

import json
import csv
data = open("SRInFlow.json",encoding="utf8")
rows = json.loads(data.read())
r=rows.values()
fieldnames = [b'dateTimeValues', b'timeSeries']
with open('C:/DeepLearning/tensorflowpoc/Codes/SRInFlow.csv', 'w') as f:
    dict_writer = csv.DictWriter(f, fieldnames=fieldnames)
    dict_writer.writeheader()
    for d in r:
  --->    dict_writer.writerow(d)

The error displays in the last line. How to rectify the error? Thanks in advance

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 datascience.stackexchange
scroll top