Python Forum
Deleting multiple variables/arrays
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deleting multiple variables/arrays
#1
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, ...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to write the condition for deleting multiple lines? Lky 3 1,100 Jul-10-2022, 02:28 PM
Last Post: Lky
  how to join by stack multiple types in numpy arrays caro 1 1,110 Jun-20-2022, 05:02 PM
Last Post: deanhystad
  Storing variables into one file for use in multiple Jupyter notebooks devansing 1 1,696 Feb-05-2022, 10:04 AM
Last Post: ibreeden
  How can I assign "multiple variables" to a single "value"? Psycpus 2 1,810 Oct-04-2021, 03:29 AM
Last Post: deanhystad
  print function help percentage and slash (multiple variables) leodavinci1990 3 2,419 Aug-10-2020, 02:51 AM
Last Post: bowlofred
  Help Setting Multiple Variables bzowk 0 1,575 Jul-18-2020, 06:59 PM
Last Post: bzowk

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020