bundles / IPython 9.13.0 / IPython / core / magics / namespace / NamespaceMagics / whos
function
IPython.core.magics.namespace:NamespaceMagics.whos
Signature
def whos ( self , parameter_s = '' ) Summary
Like %who, but gives some extra information about each variable.
Extended Summary
The same type filtering of %who can be applied here.
For all variables, the type is printed. Additionally it prints:
For {},[],(): their length.
For numpy arrays, a summary with shape, number of elements, typecode and size in memory.
For DataFrame and Series types: their shape.
Everything else: a string representation, snipping their middle if too long.
Examples
Define two variables and list them with whos:: In [1]: alpha = 123 In [2]: beta = 'test' In [3]: df = pd.DataFrame({"a": range(10), "b": range(10,20)}) In [4]: s = df["a"] In [5]: %whos Variable Type Data/Info -------------------------------- alpha int 123 beta str test df DataFrame Shape: (10, 2) s Series Shape: (10, )Aliases
-
IPython.core.magics.NamespaceMagics.whos