How to delete multiple pandas (python) dataframes from memory to save RAM?

后端 未结 3 667
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 12:22

I have lot of dataframes created as part of preprocessing. Since I have limited 6GB ram, I want to delete all the unnecessary dataframes from RAM to avoid running out of mem

3条回答
  •  春和景丽
    2020-11-27 12:47

    This will delete the dataframe and will release the RAM/memory

    del [[df_1,df_2]]
    gc.collect()
    df_1=pd.DataFrame()
    df_2=pd.DataFrame()
    

提交回复
热议问题