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
Python has a built in CSV module that could help. E.g.
import csv with open('example.csv', 'rb') as csvfile: sniffer = csv.Sniffer() has_header = sniffer.has_header(csvfile.read(2048)) csvfile.seek(0) # ...