I present to you a Simplified Approach to Inputting Data into MESSAGEix without MS Excel.
This improved method for inputting data into MESSAGEix offers a user-friendly tabular format, eliminating the need for MS Excel files and version management of codes and xlsx files separately. It utilizes comma-separated values (CSV) fed to a string, which is then merged with the year_df dataset. The resulting table can be used as input to the parameter, simplifying the data input process for non-coders.
Create a CSV and store it as string in a variable.
4. Finally, feed the merged table into the parameter function.
```scenario.add_par("var_cost",merged_var_cost)```
This method can be introduced in Westeros tutorials to help new users write and see data as well as code in single ipynb file. Major advantage over using ```for``` loop mentioned in Westeros tutorial is the ability to change data for future model years.
This is my small and humble contribution in open-source community of MESSAGEix.
Thank you for patient reading!
Dear Researchers,
I present to you a Simplified Approach to Inputting Data into MESSAGEix without MS Excel.
This improved method for inputting data into MESSAGEix offers a user-friendly tabular format, eliminating the need for MS Excel files and version management of codes and xlsx files separately. It utilizes comma-separated values (CSV) fed to a string, which is then merged with the
year_df
dataset. The resulting table can be used as input to theparameter
, simplifying the data input process for non-coders.Create a CSV and store it as string in a variable.
Read the CSV and String file and store it in new variable.
df_var_cost = pd.read_csv(StringIO(data_var_cost))
Now merge the newly created variable with
year_df
. This step can be modified to mergeyear_vtg
oryear_act
.merged_var_cost = pd.merge(year_df, df_var_cost, on='key').drop('key', axis=1)