-1

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?

Ir8_mind
  • 842
  • 5
  • 9

1 Answers1

0

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
Mustafa Quraish
  • 692
  • 4
  • 10