1. 程式人生 > 實用技巧 >NLP-資料讀取與資料分析

NLP-資料讀取與資料分析

Task2 資料讀取與資料分析

一、資料讀取

1 import pandas as pd
2 train_df = pd.read_csv('./train_set.csv', sep='\t')

首先對read_csv的函式有個清晰的認識,具體的引數的情況如下:

  • filepath_or_buffer: str,pathlib。str, pathlib.Path, py._path.local.LocalPath or any object with a read() method (such as a file handle or StringIO)
    • 可以是URL,可用URL型別包括:http, ftp, s3和檔案。對於多檔案正在準備中
    • 本地檔案讀取例項: