Is it possible to use read_csv to read only specific lines?

前端 未结 4 604
天涯浪人
天涯浪人 2021-01-02 14:00

I have a csv file that looks like this:

TEST  
2012-05-01 00:00:00.203 ON 1  
2012-05-01 00:00:11.203 OFF 0  
2012-05-01 00:00:22.203 ON 1  
2012-05-01 00:00         


        
4条回答
  •  旧巷少年郎
    2021-01-02 14:41

    http://pandas.pydata.org/pandas-docs/stable/generated/pandas.io.parsers.read_csv.html?highlight=read_csv#pandas.io.parsers.read_csv

    skiprows : list-like or integer Row numbers to skip (0-indexed) or number of rows to skip (int)

    Pass [0, 6] to skip rows with "TEST".

提交回复
热议问题