Memoryerror: Unable To Allocate Array With Shape (118, 840983) And Data Type Float64
I'm getting the following error: MemoryError: Unable to allocate array with shape (118, 840983) and data type float64 in my python code whenever I am running a python pandas.rea
Solution 1:
The MemoryError
means, you file is too large to readcsv in one time, you need used the chunksize
to avoid the error.
just like:
import pandas as pd
df = pd.read_csv("LANGEVIN_DATA.txt", delim_whitespace=True, chunksize=1000)
you can read the official document for more help.
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html
Post a Comment for "Memoryerror: Unable To Allocate Array With Shape (118, 840983) And Data Type Float64"