Why is json.dump not writing to my file correctly? or How do I properly format data before using json

16 Replies, 1098 Views

OP here—thanks y’all! The `with` block trick worked like a charm. Turns out I was forgetting to close the file, and the data was vanishing into the abyss.

But now I’ve got a *new* headache: some of my data has NaN values, and json.dump hates those. Any quick fixes?

Also, big shoutout to the `orjson` suggestion—gonna try that next. Y’all are lifesavers!

Messages In This Thread



Users browsing this thread: 1 Guest(s)