I have a 0.7 GB MongoDB database containing tweets that I am trying to load into a dataframe. However, I am getting an error.
MemoryError:
My code is as follows:
cursor = tweets.find() #Where tweets is my collection tweet_fields = ['id'] result = DataFrame(list(cursor), columns = tweet_fields)
I tried the methods in the following answers, which at some point create a list of all database items before loading it.
However, in another answer that talks about list (), the person said that it is good for small data sets because everything is loaded into memory.
In my case, I think this is the source of the error. This is too much data to load into memory. What other method can I use?
source share