You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Input In [3], in <cell line: 2>()
1 fp = "lci-example.csv"
----> 2 i = bw2io.CSVImporter(fp)
File ~/GitHub/brightway2-io/bw2io/importers/excel.py:109, in ExcelImporter.__init__(self, filepath)
105 start = time()
106 data = self.extractor.extract(filepath)
--> 109 data = [(x, y) for x, y in data if valid_first_cell(x, y)]
110 print(
111 "Extracted {} worksheets in {:.2f} seconds".format(
112 len(data), time() - start
113 )
114 )
115 if data and any(line for line in data):
File ~/GitHub/brightway2-io/bw2io/importers/excel.py:109, in <listcomp>(.0)
105 start = time()
106 data = self.extractor.extract(filepath)
--> 109 data = [(x, y) for x, y in data if valid_first_cell(x, y)]
110 print(
111 "Extracted {} worksheets in {:.2f} seconds".format(
112 len(data), time() - start
113 )
114 )
115 if data and any(line for line in data):
ValueError: too many values to unpack (expected 2)
It seems it is expecting to receive items of length of 2 when iterating over data, but items in data have a length superior to 2.
The text was updated successfully, but these errors were encountered:
romainsacchi
changed the title
Issue when import CSV inventories
Issue when importing CSV inventories
May 26, 2022
The import of CSV inventory files using
bw2io.CSVImporter()
fails.For example, using the CSV located at : https://raw.githubusercontent.com/brightway-lca/brightway2-io/master/bw2io/data/examples/example.csv
throws the following error:
It seems it is expecting to receive items of length of 2 when iterating over
data
, but items indata
have a length superior to 2.The text was updated successfully, but these errors were encountered: