I got a big txt file(about 100M) of a list like string as below:
[{'a':'1','b':null}, {'a':'2', 'b':'3'}, {'a':'4', 'b':'5'} ....]
and I want convert this file to a list or panda dataframe. I am using Anaconda and I have read the solution in Convert string representation of list to list, and tried the code below:
import ast
with open('content.txt') as f:
s = f.read()
l = ast.literal_eval(s)
I first cut a few items from the original file to create a small test case file, when the test case was not big, this code went really well, but once I pass in the whole big file, the Anaconda just went really slow and died. I wonder if there is some way to handle with big file list like string efficiently?