Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to delete object from memory?

I have a very large dataset dt, which I split into train/test:

train_dt = dt().iloc[: dt.shape[0] * 8 // 10]

test_dt= dt().iloc[dt.shape[0] * 8 // 10:]

After I do that, I want to remove dt from memory, to keep more memory in ram. How to do that? I can do smth likedt = 0, but is there any better solution?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

del variable can be used to delete a variable:

train_dt = dt().iloc[: dt.shape[0] * 8 // 10]
test_dt= dt().iloc[dt.shape[0] * 8 // 10:]
del dt
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading