我已将数据收集到csv文件中,数据如下:
1)username;date;retweets;favorites;text;geo;mentions;hashtags;id;permalink
2)CFSharing;2017-05-27 01:59;0;0;"£5 million raised for Manchester bombing victims in just three days #love http:// crowdfunding.einnews.com/article/383427 730/5ppRHGKOfQkNtAFM?ref=rss&ecode=SQUvWbWCp_PWzTRB …";;;#love;"868255418203557888";https://twitter.com/CFSharing/status/868255418203557888
3)TracksuitDavid;2017-05-27 01:58;1;0;"Tony Blair has been eerily silent on the Manchester bombing . For one very good reason. https://www. thecanary.co/2017/05/26/ton y-blair-eerily-silent-manchester-bombing-one-good-reason/ … via @thecanarysays";;@thecanarysays;;"868254940548001792";https://twitter.com/TracksuitDavid/status/868254940548001792
第一行包含列名,其余行是数据。在
如何将数据转换为json文件,该文件如下所示:
^{pr2}$注意:数字1)
,2)
,3)
代表行号
这可以使用Python ^{} 完成,如下所示:
相关问题 更多 >
编程相关推荐