Equivalent of "whos" command in NumPy
If you are using IPython, there is a whos
command built-in:
In [9]: whosVariable Type Data/Info-------------------------------a ndarray 4x4x3: 48 elems, type `int64`, 384 bytesb 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.
This more or less works as who equivalent.
In the interactive shell (IDLE)
>> import os>> import sys>> a = 10>> def MyWho(): print [v for v in globals().keys() if not v.startswith('_')]>> MyWho()['a', 'MyWho', 'sys', 'os']>> import numpy>> MyWho()['a', 'MyWho', 'numpy', 'sys', 'os']