Adding two Series with NaNs

前端 未结 3 1061
孤街浪徒
孤街浪徒 2020-11-29 10:22

I\'m working through the \"Python For Data Analysis\" and I don\'t understand a particular functionality. Adding two pandas series objects will automatically align the index

3条回答
  •  悲&欢浪女
    2020-11-29 10:33

    Pandas does not assume that 500+NaN=500, but it is easy to ask it to do that: a.add(b, fill_value=0)

提交回复
热议问题