Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions clevercsv/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down