我有一个Json文件,其中包含了我使用Scrapy从一个网站抓取的数据,我的下一步是清除数据文本中的特殊字符和停止字,并保存在Excel文件中,以备下一步。 数据如下:
{"title": ["\u2605\u2605 The New J7 - Social Offer \u2605\u2605"], "seller": ["Galaxy"]}
我需要做的是:
阅读每个项目
删除特殊字符,我不知道如何读取,因为它们是这样解码的:\u2605\u2605
删除停止语
将新数据保存到Excel文件中
我读过很多关于将Json导入Excel的线程,但是都声明了一种在整个块中同时导入Json而不修改数据的方法。在
编辑:
这是我最后的代码,它读取json文件,编辑值并保存到excel中,我希望它也能帮助其他人。在
^{pr2}$
在这种情况下,熊猫是你的朋友。在
要获得一个停止字列表,如果您还没有,您应该调查nltk。在
相关问题 更多 >
编程相关推荐