Deleting multiple variables/arrays - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Deleting multiple variables/arrays (/thread-29116.html) |
Deleting multiple variables/arrays - Robotguy - Aug-18-2020 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, ... |