0

I have a dataframe in python (Spyder) of length (5830, 14) called 'clearedVols', which shows buys and sells of energy in each hour of a given day for different generating units. These units are in one of the columns called 'Resource', and a specific unit can appear many times in the Dataframe if it buys and sells in multiple hours of the trading day.

clearedVols

I then have another dataframe called 'unitClassification' of length (612, 2) which lists each unit in one column, and describes the type of unit in the other, whether it be a wind unit, gas unit, storage unit etc.

unitClassification

I would like to create a new column in the clearedVols dataframe, which labels each row based on what type the unit is from the unitClassification dataframe, but not sure how to code this. I essentially want to compare each 'UNIT' in the clearedVols dataframe with the same column in the unitClassification dataframe, named 'Resource Code', and if they match, assign it the label given in unitClassification. Output as something like this:

clearedVol_newColumn

Any help would be appreciated, thanks.

K.Best
  • 3
  • 3

0 Answers0