python3 pandas: how to fast find the latest number of months that have value is not 0

前端 未结 0 805
谎友^
谎友^ 2020-12-11 10:32

There is Dataframe as following:

id  year month y sinx
 1  2019  1    0   1
 1  2019  2    0   2
 1  2019  3    1   3
 1  2019  4    0   4 
 1  2019  5    0           


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题