0

So I have a df with temperature data for 2 different periods 2015 and other. I would like to create a 3rd column which returns value for 2015 if greater than other but 0 if less.

joined df

I tried this :

joined =x.join(y, lsuffix='2015', rsuffix='other')

joined.Data_Value2015.apply(lambda x: x if x > joined.Data_Valueother else 0 )
eshirvana
  • 23,227
  • 3
  • 22
  • 38
Oni
  • 1

0 Answers0