Skip to content Skip to sidebar Skip to footer

Could Not Reserve Memory Block, Import Json Error In Python

import pandas as pd with open(r'data.json') as f: df = pd.read_json(f, encoding='utf-8') Im getting 'Could not reserve memory block' error. Json has 300 mb size, is there any

Solution 1:

So after reading plenty of posts and solutions I decided to just reduce my file size by getting rid of uselles data. Maybe you find this usefull. Btw. I read somewhere that u need at least x25 more memory than your json file has, so in my case i needed more than 8Gb.

with open('data.json', 'r') as data_file:
    data = json.load(data_file)

print(data.keys())
del data['author']

with open('datav2.json', 'w') as data_file:
    data = json.dump(data, data_file)

Post a Comment for "Could Not Reserve Memory Block, Import Json Error In Python"