Getting "JSONDecodeError: Expecting value: line 1 column 1 (char 0)" error when I try to read the Twitter streaming data I downloaded using Stream and saving in txt format.
Have tried various changes to the codes as suggesting in similar questions but none worked.
If I remove (errors='ignore') from open, I am getting the following error UnicodeDecodeError
# String of path to file: tweets_data_path
tweets_data_path = 'Tweets.txt'
# Initialize empty list to store tweets: tweets_data
tweets_data = []
# Open connection to file
tweets_file = open(tweets_data_path, "r", errors='ignore')
# Read in tweets and store in list: tweets_data
for line in tweets_file:
if line.strip():
tweets_data.append(json.loads(line))
# Close connection to file
tweets_file.close()
I am getting "JSONDecodeError: Expecting value: line 1 column 1 (char 0)" error when I run the above line of codes in Jupyter notebook.