1

When I'm trying to read the data I'm getting the following error. MemoryError: Unable to allocate 1.00 MiB for an array with shape (131072,) and data type int64

Please find the code that I have used

print("creating the dataframe from data.csv file..")
df = pd.read_csv('data.csv', sep=',', 
                       names=['movie', 'user','rating','date'])
df.date = pd.to_datetime(df.date)
print('Done.\n')

# we are arranging the ratings according to time.
print('Sorting the dataframe by date..')
df.sort_values(by='date', inplace=True)
print('Done..')

Please find the attached image for your reference. enter image description here

Saranraj K
  • 412
  • 1
  • 7
  • 19
  • Does this answer your question? [Unable to allocate array with shape and data type](https://stackoverflow.com/questions/57507832/unable-to-allocate-array-with-shape-and-data-type) – Mayank Porwal Apr 11 '20 at 07:32
  • Not data tyes, I'm reading 8 billion records. – Saranraj K Apr 11 '20 at 07:51
  • If you are trying to read 8 billion records into RAM I would recommend you use a database and SQL to process your data. – Ethan Apr 11 '20 at 09:04

0 Answers0