pandas.DataFrame.to_csv
来源:互联网 发布:qserialport 发送数据 编辑:程序博客网 时间:2024/06/06 19:24
pandas.DataFrame.to_csv
DataFrame.
to_csv
(path_or_buf=None, sep=’, ’, na_rep=”, float_format=None, columns=None, header=True, index=True, index_label=None, mode=’w’, encoding=None, compression=None, quoting=None, quotechar=’”’, line_terminator=’\n’, chunksize=None, tupleize_cols=False, date_format=None, doublequote=True, escapechar=None, decimal=’.’)[source]Parameters: path_or_buf : string or file handle, default None
File path or object, if None is provided the result is returned as a string.
sep : character, default ‘,’
Field delimiter for the output file.
na_rep : string, default ”
Missing data representation
float_format : string, default None
Format string for floating point numbers
columns : sequence, optional
Columns to write
header : boolean or list of string, default True
Write out column names. If a list of string is given it is assumed to be aliases for the column names
index : boolean, default True
Write row names (index)
index_label : string or sequence, or False, default None
Column label for index column(s) if desired. If None is given, and header and indexare True, then the index names are used. A sequence should be given if the DataFrame uses MultiIndex. If False do not print fields for index names. Use index_label=False for easier importing in R
mode : str
Python write mode, default ‘w’
encoding : string, optional
A string representing the encoding to use in the output file, defaults to ‘ascii’ on Python 2 and ‘utf-8’ on Python 3.
compression : string, optional
a string representing the compression to use in the output file, allowed values are ‘gzip’, ‘bz2’, ‘xz’, only used when the first argument is a filename
line_terminator : string, default
'\n'
The newline character or character sequence to use in the output file
quoting : optional constant from csv module
defaults to csv.QUOTE_MINIMAL. If you have set a float_format then floats are converted to strings and thus csv.QUOTE_NONNUMERIC will treat them as non-numeric
quotechar : string (length 1), default ‘”’
character used to quote fields
doublequote : boolean, default True
Control quoting of quotechar inside a field
escapechar : string (length 1), default None
character used to escape sep and quotechar when appropriate
chunksize : int or None
rows to write at a time
tupleize_cols : boolean, default False
write multi_index columns as a list of tuples (if True) or new (expanded format) if False)
date_format : string, default None
Format string for datetime objects
decimal: string, default ‘.’
Character recognized as decimal separator. E.g. use ‘,’ for European data
New in version 0.16.0.
to_csv精度设置
df_data.to_csv(outfile, index=False,header=False, float_format='%.3f')
- pandas.DataFrame.to_csv
- pandas.DataFrame.to_csv
- pandas的to_csv方法
- pandas.read_csv to_csv参数详解
- Pandas DataFrame
- Pandas(DataFrame)
- pandas-dataframe
- pandas.DataFrame.any与pandas.DataFrame.all
- Pandas之DataFrame操作
- Pandas.Dataframe使用小结
- Pandas之Dataframe操作
- pandas.DataFrame 操作
- Pandas学习:DataFrame
- pandas string转dataframe
- Pandas DataFrame操作
- pandas之DataFrame创建
- pandas.Dataframe 的合并
- pandas.DataFrame.iterrows
- 关于QObject::connect函数参数问题
- 请求重定向并且传递参数的方式
- C指针
- isset和empty的区别
- BZOJ 4517 [Sdoi2016]排列计数
- pandas.DataFrame.to_csv
- 通过Java代码将数据追加到文件尾部的方法总结
- Ueditor自定义图片上传接口-PHP版
- Java学习,day02: 数据类型强制转换问题
- Python学习总结
- 记录:vs中使用Unicode字符集时,wcout的问题
- Android中EditText在ListView中会出现消失的情况
- dubbo泛化调用
- 去除input边框和去除当点击input框时显示的边框