Closed cheolhung closed 12 months ago
You can use the axis
keyword-argument of the subtract()
method (or divide()
if you want to have the relative difference). See the tutorial notebook at https://github.com/danielhuppmann/ENGAGE-pyam-tutorial/ for an example.
Please close this issue if this answer was sufficient, or let me know if you need more help.
Thanks a million!
I have another issue with algebraic operations. If I use 'append=True', there is an error such as 'ValueError: Timeseries data has overlapping values:' Would you please help me fix it? Thanks in advance.
My guess is that you have executed this cell twice - so you already appended the date, and then try to append it again. To which pyam (rightly) raises an error that there is overlapping (duplicate) data between the already data in df
and the to-be-appended data.
I thought the error occurred when I executed the first time. Now I see that the to-be-appended data is already in the data frame. I really appreciate your prompt reply.
How do algebraic operations between scenarios with a IamDataFrame? For example, If I want to calculate the difference of primary energy between Scenario A and Scenario B, and append a new timeseries with a new scenario name in the frame, Is there any function to do it easily? (I couldn't find any help from pyam webpage)
Thanks in advance.