Dataframe.to_csv(path_or_buf None, sep , ’, columns None, header True, index True, mode w , encoding None)
path_or_buf :文件路径
sep :分隔符 默认用 , 隔开
columns :选择需要的列索引
header :boolean or list of string, default True,是否写进列索引值
index:是否写进行索引
mode:‘w’ 重写, ‘a’ 追加
pd.read_json(path_or_buf None, orient None, typ frame , lines False)
path_or_buf : 路径
orient : string,以什么样的格式显示.下面是5种格式
1.split 将索引总结到索引 列名到列名 数据到数据。将三部分都分开了
2.records 以columns values的形式输出
3.index 以index {columns values}…的形式输出
4.columns 以columns:{index:values}的形式输出
5.values 直接输出值
lines : boolean, default False
typ : default ‘frame’ 指定转换成的对象类型series或者dataframe
Dataframe.to_json(path_or_buf None, orient None, lines False) 将Pandas 对象存储为json格式
path_or_buf None 文件地址
orient:存储的json形式 {‘split’,’records’,’index’,’columns’,’values’}
lines:一个对象存储为一行
# data.to_csv( data_v1.csv , header True, index True)
# print(pd.read_csv( data_v1.csv ))
# json_df pd.read_json( 1.json , orient records , lines True)
# print(json_df)
# print(pd.isnull(data)) # 判断是否是缺失值 是则返回False
# print(np.all(pd.isnull(data))) # np.all()只要有一个就返回False
# print(pd.notnull(data)) # 判断是否是缺失值 是则返回True
# print(np.all(pd.notnull(data))) # np.all()只要有一个就返回Ture