Dataframe和checcking EventTime的单调新月

时间:2017-11-14 11:24:56

标签: python pandas dataframe

鉴于以下数据框,我想:

1)检测eventTime不是单调新月(以秒为单位的两个连续值之间的差值应该<0)

2)关于如何解决它的任何建议,加上或减去单调新月的x秒?

输入DF:

$(document).on 'turbolinks:load', ->
  if $('#restaurant-map').length > 0 && page.included_google_maps_js_api == undefined
    google_maps_api_key = 'xxx'
    $.getScript('https://maps.googleapis.com/maps/api/js?key=' + google_maps_api_key + '&callback=initMap')
    page.included_google_maps_js_api = true
  else if ($('#restaurant-map').length > 0)
    initMap()

输出DF:

  uuid,eventTime,Op.progress,Op.progressPercentage,AnotherAttribute
0,C0972765-8436-0000-0000-000000000000,2017-08-19T12:52:39,P,3.0,01:57:00
1,C0972765-8436-0000-0000-000000000000,2017-08-19T12:53:55,P,3.0,01:56:00
2,C0972765-8436-0000-0000-000000000000,2017-08-19T12:53:18,P,4.0,01:55:00
3,C0972765-8436-0000-0000-000000000000,2017-08-19T12:53:17,P,4.0,01:55:00
4,C0972765-8436-0000-0000-000000000000,2017-08-19T12:53:49,P,5.0,01:55:00
5,C0972765-8436-0000-0000-000000000000,2017-08-19T12:55:24,P,5.0,01:54:00
6,C0972765-8436-0000-0000-000000000000,2017-08-19T12:55:07,P,6.0,01:54:00
7,C0972765-8436-0000-0000-000000000000,2017-08-19T12:55:27,P,6.0,01:53:00
8,C0972765-8436-0000-0000-000000000000,2017-08-19T13:33:46,W,40.0,01:13:00
9,C0972765-8436-0000-0000-000000000000,2017-08-19T13:40:10,N,51.0,02:00:00

通过计算row0和row6之间以秒为单位的距离并将其潜水5 = =非单调的行数来生成输出。

非常感谢任何建议。提前谢谢了。最诚挚的问候,卡罗

0 个答案:

没有答案