Implement converters parameter in read_csv()
Closed this issue · 0 comments
akharche commented
Implement lambda converters in read_csv()
def category_converter(x):
if x is '':
return np.int32(0)
else:
return np.int32(int(x, 16))
names = ["{0}".format(i) for i in range(40)]
converter = {name: category_converter for name in names}
df = pd.read_csv(dataset_path, delimiter='\t', names=names, converters=converter)