How do you set up a dictionary, so that you can insert information from a dataframe in a certain format?
How do you set up a dictionary, so that you can insert information from a dataframe in a certain format?
You must use orient="records".
maindf.to_json(orient="records")
or
maindf.to_json(orient="columns")