Open willu47 opened 4 years ago
I think it would be better to use separate DataFrames, one for each year. This would make it a lot easier to add and remove years to and from the analysis, without changing the format of the output data (e.g. adding columns with years in the name).
At present, years in the analysis are represented by separate columns with the year integer in string for e.g.
MyVariableName2015
, orMyVariableName2030
.This then requires a lot of string formatting operations to index the year data, which is probably quite slow.
https://github.com/OnSSET/onsset/blob/0e0cf945fdb5267fdd5dbbbb3541d5c31b2b7dc5/onsset/onsset.py#L1722-L1728
It would be better to include a
year
column, so that every row is associated with a particular year, and then use a multi-index, or to use separate dataframes, one for each year.