AttributeError: "STR" L'oggetto non ha "tasti"
Domanda
Durante la conversione del file JSON in CSV, ho ricevuto l'errore sopra il mio codice è mostrato di seguito:
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)
L'errore viene visualizzato nell'ultima riga. Come correggere l'errore? Grazie in anticipo
Nessuna soluzione corretta
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a datascience.stackexchange