日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

panda.read_csv的常用参数说明

發(fā)布時(shí)間:2025/7/25 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 panda.read_csv的常用参数说明 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

pandas.read_csv

原型

pandas.read_csv(filepath_or_buffer, sep=', ', delimiter=None, header='infer', names=None, index_col=None, usecols=None, squeeze=False, prefix=None, mangle_dupe_cols=True, dtype=None, engine=None, converters=None, true_values=None, false_values=None, skipinitialspace=False, skiprows=None, nrows=None, na_values=None, keep_default_na=True, na_filter=True, verbose=False, skip_blank_lines=True, parse_dates=False, infer_datetime_format=False, keep_date_col=False, date_parser=None, dayfirst=False, iterator=False, chunksize=None, compression='infer', thousands=None, decimal='.', lineterminator=None, quotechar='"', quoting=0, escapechar=None, comment=None, encoding=None, dialect=None, tupleize_cols=False, error_bad_lines=True, warn_bad_lines=True, skipfooter=0, skip_footer=0, doublequote=True, delim_whitespace=False, as_recarray=False, compact_ints=False, use_unsigned=False, low_memory=True, buffer_lines=None, memory_map=False, float_precision=None)

?

參數(shù)很多,下面就常用的參數(shù)給出說(shuō)明,詳細(xì)請(qǐng)參考panda文檔?:

?

filepath_or_buffer :?要讀取的csv文件的URL,本地或者遠(yuǎn)程文件均可。

header?: int or list of ints, default ‘infer’?

Row number(s) to use as the column names, and the start of the data. Default behavior is as if set to 0 if no?names?passed, otherwise?None. Explicitly pass?header=0?to be able to replace existing? names. The header can be a list of integers that specify row locations for a multi-index on the columns e.g. [0,1,3]. Intervening rows that are not specified will be skipped (e.g. 2 in this example is skipped). Note that this parameter ignores commented lines and empty lines if?skip_blank_lines=True, so header=0 denotes the first line of data rather than the first line of the file.

names?: array-like, default None

List of column names to use. If file contains no header row, then you should explicitly pass header=None. Duplicates in this list are not allowed unless mangle_dupe_cols=True, which is the default.

mangle_dupe_cols?: boolean, default True

Duplicate columns will be specified as ‘X.0’...’X.N’, rather than ‘X’...’X’. Passing in False will cause data to be overwritten if there are duplicate names in the columns.

skip_blank_lines?: boolean, default True

If True, skip over blank lines rather than interpreting as NaN values

?

返回值:Read CSV (comma-separated) file into DataFrame

?

轉(zhuǎn)載于:https://www.cnblogs.com/zhuangliu/p/6374853.html

總結(jié)

以上是生活随笔為你收集整理的panda.read_csv的常用参数说明的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。