如何从json-fi中获得不同或唯一的字符串行

2024-04-19 17:25:33 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个包含以下数据的tweets的json文件。你知道吗

ID、全名、文本、时间戳、URL用户、全名、转发等

每个json文件都是唯一的,但在某些json中,['TEXT']字段是相同的。你知道吗

我想删除那些在['text']字段中包含相同tweet的json文件。你知道吗

下面是我的json文件的示例。。两个json都来自不同的用户,但它们发送相同的文本。你知道吗

    {
  'fullname': 'آدم',
  'id': '772154564711768064',
  'likes': '5',
  'replies': '0',
  'retweets': '0',
  'text': '#GoNawazGoNawaz\n''This woman has realized the truth....hope nation realizes it ''too.... \n''#PanamaLeaks\n''#GoNawazGoNawazpic.twitter.com/6m7nWgldQp',
  'timestamp': '2016-09-03T19:29:28',
  'url': '/NaikOlad/status/772154564711768064',
  'user': 'NaikOlad'
}{
  'fullname': 'سلمان اعوان',
  'id': '772156567542231040',
  'likes': '0',
  'replies': '0',
  'retweets': '0',
  'text': '#GoNawazGoNawaz\n''This woman has realized the truth....hope nation realizes it ''too.... \n''#PanamaLeaks\n''#GoNawazGoNawazpic.twitter.com/L2tZUOVs1z',
  'timestamp': '2016-09-03T19:37:26',
  'url': '/SaluBhai420/status/772156567542231040',
  'user': 'SaluBhai420'
}

Tags: 文件text用户文本idjsonthishas