I am new to Numpy and trying to search for a function to list out the variables along with their sizes (both the matrix dimensions as well as memory usage).
I am essentially looking for an equivalent of the "whos" command in MATLAB and Octave. Does there exist any such command in NumPy?
If you are using IPython, there is a whos
command built-in:
In [9]: whos
Variable Type Data/Info
-------------------------------
a ndarray 4x4x3: 48 elems, type `int64`, 384 bytes
b ndarray 100000: 100000 elems, type `int64`, 800000 bytes (781 kb)
np module <module 'numpy' from '/Li<...>kages/numpy/__init__.py'>
In general I highly recommend using IPython when doing interactive work in python with numpy/scipy/matplotlib/etc. Fernando Perez and others are actively adding a lot of great features.