Why can't I apply shift from within a pandas function?

前端 未结 3 1784
陌清茗
陌清茗 2020-12-21 08:26

I am trying to build a function that uses .shift() but it is giving me an error. Consider this:

In [40]:

data={\'level1\':[20,19,20,21,25,29,30,31,30,29,31]         


        
3条回答
  •  天涯浪人
    2020-12-21 08:45

    I'm not entirely following along, but if frame['level1'].shift(1) works, then I can only imagine that frame['level1'] is not a numpy.int64 object while whatever you are passing into the verticaladd function is. Probably need to look at your types.

提交回复
热议问题