【发布时间】:2018-06-30 05:02:10
【问题描述】:
我目前正在尝试开发一个比较行内数据的代码。该程序的目标是比较速度差异,如果速度差异很大,我希望它打印时间戳。以下是我目前写的:
for row in cj1:
speed = row[1].speed
timestamp = row[0].timestamp
for i in range(1, row.length):
if speed is different =!:
Calculate acceleration
if acceleration > #certain amount:
print(timestamp)
Else:
timestamp = rows[i].timestamp
speed = rows[i].speed
这是一个非常粗略的代码,我不太清楚如何表达它。有人可以帮忙吗?
【问题讨论】:
-
你在使用 Python 3 吗?
-
是的,我正在使用 Python 3
标签: python dataframe timestamp data-science