I have a JSON Lines file that I would like to read as a string in Python. The file contains multiple JSON objects in this format: I tried the following code in Python but it returned an error. I was able to load the file as a list of dictionaries using lines = [] but apprently it doesn’t work for
Tag: jsonlines
merge & write two jsonl (json lines) files into a new jsonl file in python3.6
Hello I have two jsonl files like so: one.jsonl second.jsonl And my goal is to write a new jsonl file (with encoding preserved) name merged_file.jsonl which will look like this: My approach is like this: However I am met with this error: TypeError: Object of type generator is not JSON serializable I will apprecite your hint/help in any ways. Thank