最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

python的pandas工具包,保存.csv文件時(shí)不要表頭的實(shí)例

 更新時(shí)間:2018年06月14日 15:34:13   作者:xiaotao_1  
今天小編小編就為大家分享一篇python的pandas工具包,保存.csv文件時(shí)不要表頭的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧

用pandas處理.csv文件時(shí),有時(shí)我們希望保存的.csv文件沒(méi)有表頭,于是我去看了DataFrame.to_csv的document。

發(fā)現(xiàn)只需要再添加header=None這個(gè)參數(shù)就行了(默認(rèn)是True),

下面貼上document:

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=None, date_format=None, doublequote=True, escapechar=None, decimal='.')

Write DataFrame to a comma-separated values (csv) file
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 the column names. If a list of strings 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 index are 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 ‘a(chǎn)scii' 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
Deprecated since version 0.21.0: This argument will be removed and will always write each row of the multi-index as a separate row in the CSV file.
Write MultiIndex columns as a list of tuples (if True) or in the new, expanded format, where each MultiIndex column is a row in the CSV (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

以上這篇python的pandas工具包,保存.csv文件時(shí)不要表頭的實(shí)例就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • pycharm配置pyqt5-tools開(kāi)發(fā)環(huán)境的方法步驟

    pycharm配置pyqt5-tools開(kāi)發(fā)環(huán)境的方法步驟

    這篇文章主要介紹了pycharm配置pyqt5-tools開(kāi)發(fā)環(huán)境的方法步驟,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2019-02-02
  • Django1.7+python 2.78+pycharm配置mysql數(shù)據(jù)庫(kù)

    Django1.7+python 2.78+pycharm配置mysql數(shù)據(jù)庫(kù)

    這篇文章主要介紹了Django1.7+python 2.78+pycharm配置mysql數(shù)據(jù)庫(kù)的相關(guān)資料,需要的朋友可以參考下
    2016-10-10
  • Requests庫(kù)實(shí)現(xiàn)數(shù)據(jù)抓取與處理功能

    Requests庫(kù)實(shí)現(xiàn)數(shù)據(jù)抓取與處理功能

    本文介紹了Python中常用的第三方庫(kù)Requests的基本用法和高級(jí)功能,我們學(xué)習(xí)了如何發(fā)起HTTP請(qǐng)求、處理響應(yīng)、使用會(huì)話對(duì)象、設(shè)置代理和證書(shū)驗(yàn)證等技巧,需要的朋友可以參考下
    2023-05-05
  • Python本地及虛擬解釋器配置過(guò)程解析

    Python本地及虛擬解釋器配置過(guò)程解析

    這篇文章主要介紹了Python本地及虛擬解釋器配置過(guò)程解析,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-10-10
  • python執(zhí)行系統(tǒng)命令后獲取返回值的幾種方式集合

    python執(zhí)行系統(tǒng)命令后獲取返回值的幾種方式集合

    今天小編就為大家分享一篇python執(zhí)行系統(tǒng)命令后獲取返回值的幾種方式集合,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2018-05-05
  • Tensorflow中的placeholder和feed_dict的使用

    Tensorflow中的placeholder和feed_dict的使用

    這篇文章主要介紹了Tensorflow中的placeholder和feed_dict的使用,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2018-07-07
  • 基于Python和Tkinter實(shí)現(xiàn)高考倒計(jì)時(shí)功能

    基于Python和Tkinter實(shí)現(xiàn)高考倒計(jì)時(shí)功能

    隨著高考的臨近,每個(gè)考生都在緊鑼密鼓地復(fù)習(xí),這時(shí)候,一款實(shí)用的倒計(jì)時(shí)軟件能有效幫助你規(guī)劃剩余時(shí)間,提醒你不要浪費(fèi)每一分每一秒,今天,我們來(lái)聊聊一款基于Python和Tkinter開(kāi)發(fā)的高考倒計(jì)時(shí)軟件,功能簡(jiǎn)單卻極具實(shí)用性,讓你在緊張的備考過(guò)程中不再迷失
    2025-03-03
  • Python3.9安裝gmpy2的步驟

    Python3.9安裝gmpy2的步驟

    gmpy2是一個(gè)Python擴(kuò)展模塊,是對(duì)GMP的封裝,它的前身是gmpy,接下來(lái)通過(guò)本文給大家講解Python3.9安裝gmpy2的步驟,安裝gmpy2之前需要提前安裝python3環(huán)境,安裝python請(qǐng)自行百度搜索,不同的python版本會(huì)對(duì)應(yīng)的gmpy庫(kù)也是不同的,需要的朋友可以參考下
    2023-05-05
  • 將matplotlib繪圖嵌入pyqt的方法示例

    將matplotlib繪圖嵌入pyqt的方法示例

    這篇文章主要介紹了將matplotlib繪圖嵌入pyqt的方法示例,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-01-01
  • Python 根據(jù)數(shù)據(jù)模板創(chuàng)建shapefile的實(shí)現(xiàn)

    Python 根據(jù)數(shù)據(jù)模板創(chuàng)建shapefile的實(shí)現(xiàn)

    今天小編就為大家分享一篇Python 根據(jù)數(shù)據(jù)模板創(chuàng)建shapefile的實(shí)現(xiàn),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2019-11-11

最新評(píng)論

新竹县| 重庆市| 若羌县| 龙川县| 许昌县| 保亭| 贡嘎县| 洛南县| 磐安县| 阿图什市| 建德市| 桦川县| 通山县| 綦江县| 黔东| 东辽县| 宁都县| 柘荣县| 乌兰县| 宜阳县| 琼结县| 龙口市| 普安县| 尼玛县| 宜宾市| 开封县| 祁阳县| 中阳县| 梧州市| 都匀市| 平昌县| 榆树市| 遂平县| 光山县| 辽阳县| 綦江县| 呼和浩特市| 武夷山市| 安多县| 盐边县| 安陆市|