如何为每个id选择数据并在同一图中绘制所有曲线?

时间:2018-10-23 09:02:22

标签: python pyspark pyspark-sql

我尝试每次显示每个源ip的数据,而不是在同一图中绘制所有曲线。所以我可以比较一下。

sqlContext.registerDataFrameAsTable(btd, "Packets_EB")
df1 = sqlContext.sql("SELECT wpan_wpan_src64, wpan_tsch_time_sync_wpan_tsch_asn, frame_frame_time from Packets_EB where wpan_tsch_time_sync_wpan_tsch_asn is not NULL order by wpan_wpan_src64 ")
df1.collect()

这是我的数据示例:

[Row(wpan_wpan_src64='14:15:92:cc:00:00:00:01', wpan_tsch_time_sync_wpan_tsch_asn='707', frame_frame_time='Oct  9, 2018 09:55:48.441610333 CEST'),
         Row(wpan_wpan_src64='14:15:92:cc:00:00:00:01', wpan_tsch_time_sync_wpan_tsch_asn='1212', frame_frame_time='Oct  9, 2018 09:55:52.314076465 CEST'),
         Row(wpan_wpan_src64='14:15:92:cc:00:00:00:02', wpan_tsch_time_sync_wpan_tsch_asn='1616', frame_frame_time='Oct  9, 2018 09:55:55.578094951 CEST'),
         Row(wpan_wpan_src64='14:15:92:cc:00:00:00:01', wpan_tsch_time_sync_wpan_tsch_asn='1818', frame_frame_time='Oct  9, 2018 09:55:57.167274612 CEST'),
    .....

所以我有两个问题,我无法为每个source_ip选择数据,然后如何在同一图中绘制所有曲线?

0 个答案:

没有答案