Forward slash in json file from pandas dataframe
问题 I'm a complete newbie to json, any help is appreciated. I'm trying to convert a dataframe to a json file. import pandas as pd df = pd.DataFrame({ 'A' : [1., 2.5], 'B' : ['img/blue.png', 'img/red.png']}) print df Output is A B 0 1.0 img/blue.png 1 2.5 img/red.png I would like to make a json file that looks like this: '[1.0,"img/blue.png"],[2.5,"img/red.png"]' However, when I use the following out = df.to_json(orient='values')[1:-1] print out I get this instead '[1.0,"img\\/blue.png"],[2.5,"img