SFrame fails when first line ends with missing column

User 3104 | 1/22/2016, 5:32:11 PM

loading a file that is empty in last column of the first line fails miserably

using v1.8

import sframe as sfr

file1 = "test1.txt" file2 = "test2.txt"

two rows, three columns

f = open(file1, 'w') f.write("1\t2\t3\n4\t5\t6") f.close()

two rows, three columns (according to the tab after the second number in the first row)

but last entry in the first row is missing

f = open(file2, 'w') f.write("1\t2\t\n4\t5\t6") f.close()

sf1 = sfr.SFrame.readcsv(file1, delimiter='\t', columntype_hints=[int,int,int], header=False)

this throws an exception that there are only two columns

sf2 = sfr.SFrame.readcsv(file2, delimiter='\t', columntype_hints=[int,int,int], header=False)

while this fails to parse

sf2 = sfr.SFrame.read_csv(file2, delimiter='\t', header=False)


User 1189 | 1/25/2016, 6:26:24 PM


This seems to be a bug. You can file a bug report at

Thanks! Yucheng