You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently pandas.DataFrame.to_json supports orient=records which yields a file of [{column -> value}, ... , {column -> value}] (as a single line). I'd like to request a slight variation of this format which is a single {column -> value} per line. This yields a similar format as PostgreSQL's row_to_json() function.
Example of the TPC-H region table using orient=records
[{"r_regionkey":0,"r_name":"AFRICA","r_comment":"lar deposits. blithely final packages cajole. regular waters are final requests. regular accounts are according to "},{"r_regionkey":1,"r_name":"AMERICA","r_comment":"hs use ironic, even requests. s"},{"r_regionkey":2,"r_name":"ASIA","r_comment":"ges. thinly even pinto beans ca"},{"r_regionkey":3,"r_name":"EUROPE","r_comment":"ly final courts cajole furiously final excuse"},{"r_regionkey":4,"r_name":"MIDDLE EAST","r_comment":"uickly special accounts cajole carefully blithely close requests. carefully final asymptotes haggle furiousl"}]
desired new format:
{"r_regionkey":0,"r_name":"AFRICA","r_comment":"lar deposits. blithely final packages cajole. regular waters are final requests. regular accounts are according to "}
{"r_regionkey":1,"r_name":"AMERICA","r_comment":"hs use ironic, even requests. s"}
{"r_regionkey":2,"r_name":"ASIA","r_comment":"ges. thinly even pinto beans ca"}
{"r_regionkey":3,"r_name":"EUROPE","r_comment":"ly final courts cajole furiously final excuse"}
{"r_regionkey":4,"r_name":"MIDDLE EAST","r_comment":"uickly special accounts cajole carefully blithely close requests. carefully final asymptotes haggle furiousl"}
The text was updated successfully, but these errors were encountered:
Currently
pandas.DataFrame.to_json
supportsorient=records
which yields a file of[{column -> value}, ... , {column -> value}]
(as a single line). I'd like to request a slight variation of this format which is a single{column -> value}
per line. This yields a similar format as PostgreSQL'srow_to_json()
function.Example of the TPC-H
region
table usingorient=records
desired new format:
The text was updated successfully, but these errors were encountered: