Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I free a numpy array?

I want to remove the whole numpy array. For instance, if I make array A like

A = np.zeros((2,3))

I want to remove the whole array A and want to reuse the name 'A' in other purpose.

Are there any codes (functions) to delete the array?

like image 727
Philjoon Jung Avatar asked Apr 09 '26 11:04

Philjoon Jung


1 Answers

I want to remove the whole array A

Easy :

del A

want to reuse the name 'A' in other purpose.

Similarly easy :

A = whateverElse  # associate A with whateverElse, so simple :o)
like image 52
user3666197 Avatar answered Apr 11 '26 00:04

user3666197



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!