Please help.. writing JSON
Hello all. I am so stuck trying to write my data into a JSON file I am literally crying. I have 100 text files with three columns, a, b, and c, each containing a set number of measurements. I would like to assign each file an ID, a random number really, as well as a string that's either "X" or "Y". I would like to save the ID and string, as well as all the measurements from the columns. I tried making an array of ID and string to be the same size as the measurements, and then pass them to a dictionary:
dict = {"ID": [], "STRING": [], "col_a": [], "col_b": [], "col_c: []}
This doesn't work, it gives me an error telling me that "{} is not JSON serializable". Any help is much-appreciated thank you
Posted Aug 10, 2017, 7:15 PM UTC
Post your code.
Here it is, sorry!