How to check if a CSV has a header using Python?

前端 未结 5 558
再見小時候
再見小時候 2021-01-17 22:54

I have a CSV file and I want to check if the first row has only strings in it (ie a header). I\'m trying to avoid using any extras like pandas etc. I\'m thinking I\'ll use a

5条回答
  •  不思量自难忘°
    2021-01-17 23:46

    I think the best way to check this is -> simply reading 1st line from file and then match your string instead of any library.

提交回复
热议问题