Closed
Description
For df.to_json() the speech marks should be escaped. Currently, the json is not valid. This was already reported as an issue here #15288, but most likely incorrectly marked as duplicate with something else.
idx = pd.MultiIndex.from_product([['Zara', 'LV', 'Roots'],
['Orders', 'GMV', 'AOV']],
names=['Brand', 'Metric'])
col = ['Yesterday', 'Yesterday-1', 'Yesterday-7', 'Thirty day average']
df = pd.DataFrame('-', idx, col)
df.to_json()
'{"Yesterday":{"["Zara","Orders"]":"-","["Zara","GMV"]":"-","["Zara","AOV"]":"-","["LV","Orders"]":"-","["LV","GMV"]":"-","["LV","AOV"]":"-","["Roots","Orders"]":"-","["Roots","GMV"]":"-","["Roots","AOV"]":"-"},"Yesterday-1":{"["Zara","Orders"]":"-","["Zara","GMV"]":"-","["Zara","AOV"]":"-","["LV","Orders"]":"-","["LV","GMV"]":"-","["LV","AOV"]":"-","["Roots","Orders"]":"-","["Roots","GMV"]":"-","["Roots","AOV"]":"-"},"Yesterday-7":{"["Zara","Orders"]":"-","["Zara","GMV"]":"-","["Zara","AOV"]":"-","["LV","Orders"]":"-","["LV","GMV"]":"-","["LV","AOV"]":"-","["Roots","Orders"]":"-","["Roots","GMV"]":"-","["Roots","AOV"]":"-"},"Thirty day average":{"["Zara","Orders"]":"-","["Zara","GMV"]":"-","["Zara","AOV"]":"-","["LV","Orders"]":"-","["LV","GMV"]":"-","["LV","AOV"]":"-","["Roots","Orders"]":"-","["Roots","GMV"]":"-","["Roots","AOV"]":"-"}}'
`