bsergi / Historical-PJM-Dispatch-Curves

Code for a simple model that attempts to recreate historical dispatch curves in PJM using data from EPA and PJM in order to estimate marginal emissions factors.
0 stars 0 forks source link

Calculate cumulative sum of capacity #2

Closed gschivley closed 5 years ago

gschivley commented 6 years ago

https://github.com/bsergi/Historical-PJM-Dispatch-Curves/blob/c473d4dafa82c7683a4353d54619d7417a382956/MarginalCostFunction.py#L232

Would be faster to create a new column with the cumulative sum of capacity. Then find the index value of the dataframe where the cumsum column is still less than the load. This can also be reversed, using idxmin() for values greater than the load to find the next plant above current load.