0

I have 2 Series of data:

  1. kWR - A Series list of data with numerical values
  2. COP_bins - A Series list that's grouped by bins with mean values

I would like to be able to get a 3rd list where we would have the same amount of items as in kWR list but the values correspond to kWR / bin value.

examples

# example of the first item in kWC list
-8.994642 # which comes from (-7.739641 / -1.255001)

# example of the last item in kWC list
44.571224 # which comes from (214.135716 / 4.804349)

I tried to do something like this, but it only works with hard coded number, not with a list :/

def get_COP_from_bin(kWR, COP_bins):
    ix = COP_bins.keys().get_loc(kWR)
    return COP_bins.values[ix]

list3 = kWR / get_COP_from_bin(kWR, COP_bins)

screenshot of my lists

enter image description here

Tomasz Golinski
  • 743
  • 5
  • 25
  • 1
    Please don't post images of code, data, or Tracebacks. Copy and paste it as text then format it as code (select it and type `ctrl-k`) … [Why should I not upload images of code/data/errors when asking a question?](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors-when-asking-a-question) – wwii Jun 09 '22 at 18:17
  • 1
    [How to make good reproducible pandas examples](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) – wwii Jun 09 '22 at 18:17

0 Answers0