pyam icon indicating copy to clipboard operation
pyam copied to clipboard

Error when year-column headers are mixed int and str

Open danielhuppmann opened this issue 3 years ago • 0 comments

Per a bug report by @M-Neuwirth: if the years in the column headers are mixed between integer and strings in an IAMC-style xlsx file, importing as an IamDataFrame fails with the following error message:

~/GitHub/pyam/pyam/utils.py in format_data(df, index, **kwargs)
    320         if year_cols and not time_cols:
    321             time_col = "year"
--> 322             melt_cols = sorted(year_cols)
    323         else:
    324             time_col = "time"

TypeError: '<' not supported between instances of 'str' and 'int'

danielhuppmann avatar Jun 07 '22 09:06 danielhuppmann