pandas refuses to read files that have too many commas (after the first line) :
Trying to read_csv the following :
col1,col2,col3
foo,1,2
bar,2,3
zob,0,3,4
Will give me an error
However, pandas accepts the following no matter the options I tried in read_csv :
col1,col2,col3
foo,1,2
bar,2,3
zob,0
And will just consider that the value in col3 for the last line is null
Is there any pandas way to raise an exception when this (too few fields in one row) happens ? (In my case, it means the source of the file is faulty and the file needs to be downloaded again).
It seems error_bad_lines only concern lines with too many commas.
I can count separately the number of commas for each line before using read_csv, but I'd like to know if an option within pandas exists because it seems more natural / to ease code readability.