simplify, also its a list
This commit is contained in:
@ -15,6 +15,7 @@ def items_csv_to_dict(items_csv_reader):
|
|||||||
count = 0
|
count = 0
|
||||||
|
|
||||||
for key, col in enumerate(headers):
|
for key, col in enumerate(headers):
|
||||||
|
count += 1
|
||||||
if key == 0:
|
if key == 0:
|
||||||
item[col] = row[key]
|
item[col] = row[key]
|
||||||
elif col == 'b_param':
|
elif col == 'b_param':
|
||||||
@ -25,9 +26,8 @@ def items_csv_to_dict(items_csv_reader):
|
|||||||
'value': row[key],
|
'value': row[key],
|
||||||
'type': 'metadata'
|
'type': 'metadata'
|
||||||
})
|
})
|
||||||
elif count == (1 - len(headers.split(','))):
|
elif count == len(headers):
|
||||||
item['b_param'] = float(row[key])
|
item['b_param'] = float(row[key])
|
||||||
count += 1
|
|
||||||
|
|
||||||
items.append(item)
|
items.append(item)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user