Python Forum

Full Version: Deleting multiple variables/arrays
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey Everyone:

I often play with large arrays (>10 GBs of files) and have immense number of independent for loops in my script. Between the loops I delete the variables I no longer need to save memory (see below). The below just adds redundancy, is there a short way to achieve this and delete multiple variables in one/two/few lines ?

del chunk1
del chunks1
del chunks2
del chunks3
...

Simpler than I thought! :-)

del chunk1, chunks1, ...