How to drop_duplicates

前端 未结 1 1457
醉话见心
醉话见心 2021-01-27 15:27

I have raw data as following example. At instant t1, a variable has a value x1, this variable should be recorded at instant t2 if and only if its value is not equal to x1. There

相关标签:
1条回答
  • 2021-01-27 16:17
    df.drop_duplicates(subset=['Variable','Value'],keep='first')
    #                time Variable  Value
    #2014-07-11  19:50:20     Var1     10
    #2014-07-11  19:50:30     Var1     20
    #2014-07-11  19:50:50     Var2     30
    #2014-07-11  19:50:60     Var2     40
    #2014-07-11  19:50:70     Var2     50
    
    0 讨论(0)
提交回复
热议问题