我需要创建嵌套列表。我的txt数据是
(电话号码、时间、三角洲时间、纬度、经度)
...
0544144,23,86,40.761650,29.940929
0544147,23,104,40.768749,29.968599
0545525,20,86,40.761650,29.940929
0538333,21,184,40.764679,29.929543
05477900,21,204,40.773071,29.975010
0561554,23,47,40.764694,29.927397
...
我的代码也是
^{pr2}$如您所见,每列都有一个平均值;telophone、time、delta time等,但每一行都必须使用一个列表。 如果我想看第一个电话号码
print tel0_list[0]
输入:
0544144
它同样有效。我需要用它来创建每一行。在
例如
Data[]列表可以是每行的lıst。如果我想看到数据[1],我的输入必须像
(0544147,23,104,40.768749,29.968599)
我要怎么做?在
谢谢
由于文本文件是
csv
格式,因此如果使用Spark 2.x,可以轻松地将其加载到数据帧中:然后您可以通过以下方式访问数据:
^{pr2}$注意:在Spark中访问数据[1]没有任何意义,因为它是一个分布式系统。在
相关问题 更多 >
编程相关推荐