我正在尝试打印数据框,每一列都换行。
这是数据文件,名为sandbox.json
{"name": "jude","age": "23","address": "xyz street"}
{"name": "tommy","age": "3","address": "abs street"}
这是代码:
import pandas as pd
# read json into a dataframe
sandbox=pd.read_json("data/sandbox.json",lines=True)
# print schema
print("Schema: \n\n ",sandbox.dtypes)
这是我的期望:
Schema:
address object
age int64
name object
dtype: object
这是我实际上从终端获得的信息:
('Schema: \n\n ', address object
age int64
name object
dtype: object)
我怎么不\ n \ n却看到新的一行?