Python Forum
Replace null values in Json file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Replace null values in Json file
#11
I replied to but nobody listens Doh
:-)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#12
Sorry again,
i proved the code and when i try read the json generated, now give me error message:

with open("CON_ERROR_LUNES.json", "r") as f:
    data = json.load(f)
ValueError: Extra data: line 2 column 1 - line 6 column 1 (char 6214 - 27304)

The file has the next shape:

{"created_at":"Mon Jun 11 09:31:04 +0000 2018","id":1006106533749501957,"id_str":"1006106533749501957","text":"Mi cr\u00edtica para @Codalario de \u201cLa tabernera del puerto\u201d del Teatro Campoamor https:\/\/t.co\/xnoRsAJKZy","display_text_range":[0,76],"source":"\u003ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003eTwitter for iPhone\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":159561704,"id_str":"159561704","name":"Nuria Blanco \u00c1lvarez","screen_name":"miladomusical","location":null,"url":null,"description":"Music\u00f3loga. Cr\u00edtico musical en Scherzo y Codalario. Adoro la zarzuela. Profesora por vocaci\u00f3n.","translator_type":"none","protected":false,"verified":false,"followers_count":224,"friends_count":74,"listed_count":11,"favourites_count":996,"statuses_count":1386,"created_at":"Fri Jun 25 18:39:22 +0000 2010","utc_offset":null,"time_zone":null,"geo_enabled":true,"lang":"es","contributors_enabled":false,"is_translator":false,"profile_background_color":"642D8B","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme10\/bg.gif","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme10\/bg.gif","profile_background_tile":true,"profile_link_color":"FF0000","profile_sidebar_border_color":"65B0DA","profile_sidebar_fill_color":"7AC3EE","profile_text_color":"3D1957","profile_use_background_image":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/775392431705579520\/30Kwq6si_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/775392431705579520\/30Kwq6si_normal.jpg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/159561704\/1448747141","default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null....

I think im lost some of json files...

When i read the file, i will use replace_nulls function for replace None and next i will save the new json dict file generated. But i dont understand because i cannot read the file when 5 minutes ago i can read other file of tweets.
Thank you very much and sorry again
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Replace values in Yaml file with value in dictionary PelleH 1 2,179 Feb-11-2025, 09:51 AM
Last Post: alexjordan
  JSON File - extract only the data in a nested array for CSV file shwfgd 2 1,087 Aug-26-2024, 10:14 PM
Last Post: shwfgd
  encrypt data in json file help jacksfrustration 1 2,261 Mar-28-2024, 05:16 PM
Last Post: deanhystad
  parse json field from csv file lebossejames 4 2,050 Nov-14-2023, 11:34 PM
Last Post: snippsat
  Replace a text/word in docx file using Python Devan 4 22,072 Oct-17-2023, 06:03 PM
Last Post: Devan
  Need to replace a string with a file (HTML file) tester_V 1 1,949 Aug-30-2023, 03:42 AM
Last Post: Larz60+
  Python Script to convert Json to CSV file chvsnarayana 8 4,763 Apr-26-2023, 10:31 PM
Last Post: DeaD_EyE
  Loop through json file and reset values [SOLVED] AlphaInc 2 5,504 Apr-06-2023, 11:15 AM
Last Post: AlphaInc
  How to express null value klatlap 3 1,940 Mar-25-2023, 10:40 AM
Last Post: klatlap
  Converting a json file to a dataframe with rows and columns eyavuz21 13 14,139 Jan-29-2023, 03:59 PM
Last Post: eyavuz21

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020