numpy.who function – Python

numpy.who() function print the NumPy arrays in the given dictionary.

Syntax : numpy.who(vardict = None)
Parameters :
vardict : [dict, optional] A dictionary possibly containing ndarrays.
Return : Returns ‘None’. If there is no dictionary passed in or vardict is None then returns NumPy arrays in the globals() dictionary.

Code #1 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# Python program explaining
# numpy.who() function
           
# importing numpy as geek 
import numpy as geek 
  
a = geek.arange(5)
b = geek.ones(10)
  
gfg = geek.who()
     
print (gfg)

chevron_right


Output :

a               5                40               int64
b               10               80               float64

Upper bound on total bytes  =       120
None

 
Code #2 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# Python program explaining
# numpy.who() function
           
# importing numpy as geek 
import numpy as geek 
  
a = geek.arange(3.0)
b = geek.arange(5.0)
  
gfg = geek.who()
     
print (gfg)

chevron_right


Output :

Name            Shape            Bytes            Type
===========================================================

a               3                24               float64
b               5                40               float64

Upper bound on total bytes  =       64
None
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.