本文整理汇总了Python中vehicle.Vehicle.denoise方法的典型用法代码示例。如果您正苦于以下问题:Python Vehicle.denoise方法的具体用法?Python Vehicle.denoise怎么用?Python Vehicle.denoise使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vehicle.Vehicle
的用法示例。
在下文中一共展示了Vehicle.denoise方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: read_vehicles
# 需要导入模块: from vehicle import Vehicle [as 别名]
# 或者: from vehicle.Vehicle import denoise [as 别名]
def read_vehicles(database, query_no):
"""
read vehicle data
"""
conn = sqlite3.connect(database)
cursor = conn.cursor()
# database should have index on Sim
if query_no == "all":
cursor.execute("SELECT DISTINCT id FROM vehicles")
all_ids = cursor.fetchall()
else:
all_ids = [(no, ) for no in query_no]
vehicles = Vehicles()
for ID in all_ids:
# Order by Id?
cursor.execute("""SELECT gpstime, latitude, longitude
FROM vehicles
WHERE id = ? ORDER BY gpstime ASC""", ID)
results = cursor.fetchall()
vehicle = Vehicle(results, ID[0])
vehicle = vehicle.denoise()
vehicles.add(vehicle)
cursor.close()
conn.close()
return vehicles