I have a CSV file that I\'m reading in Python and I want the program to skip over the row if the first column is empty. How do I do this?
Right now I have:
with open('testdata1.csv', 'r') as csvfile: csvreader = csv.reader(csvfile) for row in csvreader: print(row) if row[0] in (None, ""): print("12")
Reference: How do I detect missing fields in a CSV file in a Pythonic way?