Commit 6287876e authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: Be more lenient with low numbers of sample rows. Increase number of sample

rows in file sniffing.
parent 2b602434
......@@ -123,9 +123,12 @@ def has_header(sample,
# if more than two thirds of rows
# have a different type to the header
# row, let's say we have a header.
# But be lenient at low row counts.
threshold = collections.defaultdict(lambda : 0.34)
threshold[1] = 0.0
threshold[2] = 0.51
threshold[3] = 0.66
threshold[4] = 0.76
for col, ctypes in coltypes.items():
......@@ -158,7 +161,7 @@ def sniff(datafile):
# Read the first few lines
lines = []
with open(datafile, 'rt') as f:
for i in range(4):
for i in range(10):
line = f.readline()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment