This is a development version (9.14.0.dev) and may be unstable. Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.14.0.dev / IPython / core / magics / namespace / NamespaceMagics / whos

function

IPython.core.magics.namespace:NamespaceMagics.whos

source: /IPython/core/magics/namespace.py :350

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