I need to analysis data, but file is 9Gb. When I try to open it Python is interrupted and return MemoryError
.
data = pd.read_csv("path.csv")
Is there any way to solve this problem or I should drop this file?
I need to analysis data, but file is 9Gb. When I try to open it Python is interrupted and return MemoryError
.
data = pd.read_csv("path.csv")
Is there any way to solve this problem or I should drop this file?
As mentioned by EdChum, I use chunksize=n
to open big files in chunks, then loop through the chunks to do whatever you need. Specify the number of rows you want in each 'chunk' of data and open as follows:
chunks = 100000
data = pd.read_csv("path.csv", chunksize=chunks)
for chunk in data:
print "something"
Hope this helps :)