Try several encodings to read old WEO releases
2 unresolved threads
2 unresolved threads
Related to management#786 (closed)
Edited by Christophe Benz
Merge request reports
Activity
Filter activity
60 60 return slugify(lower_unit_label, separator="_", stopwords=["of"]) 61 61 62 62 63 def dataframe_from_csv(csv_file: Path, encoding_list): 64 """Try several encodings to read csv content.""" 65 for encoding in encoding_list: 66 try: 67 return pd.read_csv(csv_file, delimiter="\t", encoding=encoding) 68 except: changed this line in version 2 of the diff
60 60 return slugify(lower_unit_label, separator="_", stopwords=["of"]) 61 61 62 62 63 def dataframe_from_csv(csv_file: Path, encoding_list): 64 """Try several encodings to read csv content.""" 65 for encoding in encoding_list: 66 try: 67 return pd.read_csv(csv_file, delimiter="\t", encoding=encoding) 68 except: 69 pass 70 raise Exception(f"Can't find an encoding to read {csv_file!r}") changed this line in version 2 of the diff
Closing in favor of !2 (merged)