Python CSV reader to skip 9 headers

前端 未结 3 1584
伪装坚强ぢ
伪装坚强ぢ 2021-01-27 07:57
import os
import csv

def get_file_path(filename):
    currentdirpath = os.getcwd()
    file_path = os.path.join(os.getcwd(), filename)
    print(file_path)
    return(f         


        
3条回答
  •  情话喂你
    2021-01-27 08:27

    If you would consider using pandas, read_csv makes reading files very straightforward:

    import pandas as pd
    
    data = pd.read_csv(filename, skiprows=9)
    

提交回复
热议问题