diff --git a/clevercsv/detect.py b/clevercsv/detect.py index 18203913..79039458 100644 --- a/clevercsv/detect.py +++ b/clevercsv/detect.py @@ -108,6 +108,11 @@ def has_header(self, sample): if thisType != columnTypes[col]: if columnTypes[col] is None: # add new column type columnTypes[col] = thisType + elif (thisType == float and columnTypes[col] == int) or ( + thisType == int and columnTypes[col] == float + ): + # mismatch between float and int, assume float + columnTypes[col] = float else: # type is inconsistent, remove column from # consideration