@@ -2212,7 +2212,9 @@ def to_json(
2212
2212
... )
2213
2213
2214
2214
>>> df.to_json(orient='split')
2215
- '{"columns":["col 1","col 2"],"index":["row 1","row 2"],"data":[["a","b"],["c","d"]]}'
2215
+ '{"columns":["col 1","col 2"],\
2216
+ "index":["row 1","row 2"],\
2217
+ "data":[["a","b"],["c","d"]]}'
2216
2218
2217
2219
Encoding/decoding a Dataframe using ``'records'`` formatted JSON.
2218
2220
Note that index labels are not preserved with this encoding.
@@ -2238,7 +2240,11 @@ def to_json(
2238
2240
Encoding with Table Schema
2239
2241
2240
2242
>>> df.to_json(orient='table')
2241
- '{"schema":{"fields":[{"name":"index","type":"string"},{"name":"col 1","type":"string"},{"name":"col 2","type":"string"}],"primaryKey":["index"],"pandas_version":"0.20.0"},"data":[{"index":"row 1","col 1":"a","col 2":"b"},{"index":"row 2","col 1":"c","col 2":"d"}]}'
2243
+ '{"schema":{"fields":[{"name":"index","type":"string"},\
2244
+ {"name":"col 1","type":"string"},{"name":"col 2","type":"string"}],\
2245
+ "primaryKey":["index"],"pandas_version":"0.20.0"},\
2246
+ "data":[{"index":"row 1","col 1":"a","col 2":"b"},\
2247
+ {"index":"row 2","col 1":"c","col 2":"d"}]}'
2242
2248
"""
2243
2249
from pandas .io import json
2244
2250
0 commit comments