- 用法:- pandas.read_fwf(filepath_or_buffer, colspecs='infer', widths=None, infer_nrows=100, **kwds)
- 將 fixed-width 格式化行的表讀入 DataFrame。 - 還支持可選地將文件迭代或分解成塊。 - 更多幫助可以在 IO Tools 的在線文檔中找到。 - filepath_or_buffer:str、路徑對象或 file-like 對象
- 字符串、路徑對象(實現 - os.PathLike[str])或 file-like 對象實現文本- read()函數。字符串可以是 URL。有效的 URL 方案包括 http、ftp、s3 和文件。對於文件 URL,需要一個主機。本地文件可以是:- file://localhost/path/to/table.csv。
- colspecs:元組列表 (int, int) 或 ‘infer’。可選的
- 一個元組列表,將每行的fixed-width 字段的範圍作為半開區間(即 [from, to[ )。字符串值 ‘infer’ 可用於指示解析器嘗試從未通過 skiprows 跳過的數據的前 100 行中檢測列規範(默認值='infer')。 
- widths:int 列表,可選
- 如果間隔是連續的,則可以使用字段寬度列表代替‘colspecs’。 
- infer_nrows:整數,默認 100
- 讓解析器確定 - colspecs時要考慮的行數。
- **kwds:可選的
- 可選的關鍵字參數可以傳遞給 - TextFileReader。
 
- DataFrame 或 TextFileReader
- 逗號分隔值 (csv) 文件作為帶有標簽軸的二維數據結構返回。 
 
 - 參數:- 返回:- 例子:- >>> pd.read_fwf('data.csv')
相關用法
- Python pandas.read_pickle用法及代碼示例
- Python pandas.read_hdf用法及代碼示例
- Python pandas.read_xml用法及代碼示例
- Python pandas.read_table用法及代碼示例
- Python pandas.read_sql_table用法及代碼示例
- Python pandas.read_excel用法及代碼示例
- Python pandas.read_stata用法及代碼示例
- Python pandas.read_sql用法及代碼示例
- Python pandas.read_csv用法及代碼示例
- Python pandas.read_html用法及代碼示例
- Python pandas.read_json用法及代碼示例
- Python pandas.arrays.IntervalArray.is_empty用法及代碼示例
- Python pandas.DataFrame.ewm用法及代碼示例
- Python pandas.api.types.is_timedelta64_ns_dtype用法及代碼示例
- Python pandas.DataFrame.dot用法及代碼示例
- Python pandas.DataFrame.apply用法及代碼示例
- Python pandas.DataFrame.combine_first用法及代碼示例
- Python pandas.Index.value_counts用法及代碼示例
- Python pandas.DatetimeTZDtype用法及代碼示例
- Python pandas.DataFrame.cumsum用法及代碼示例
注:本文由純淨天空篩選整理自pandas.pydata.org大神的英文原創作品 pandas.read_fwf。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
