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

bundles / IPython latest / IPython / core / magics / namespace / NamespaceMagics / reset

function

IPython.core.magics.namespace:NamespaceMagics.reset

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

Signature

def   reset ( self parameter_s = '' )

Summary

Resets the namespace by removing all names defined by the user, if called without arguments, or by removing some types of objects, such as everything currently in IPython's In[] and Out[] containers (see the parameters for details).

Parameters

-f

force reset without asking for confirmation.

-s

'Soft' reset: Only clears your namespace, leaving history intact. References to objects may be kept. By default (without this option), we do a 'hard' reset, giving you a new session and removing all references to objects from the current session.

--aggressive

Try to aggressively remove modules from sys.modules ; this may allow you to reimport Python modules that have been updated and pick up changes, but can have unintended consequences.

in

reset input history

out

reset output history

dhist

reset directory history

array

reset only variables that are NumPy arrays

Notes

Calling this magic from clients that do not implement standard input, such as the ipython notebook interface, will reset the namespace without confirmation.

Examples

:: In [6]: a = 1 In [7]: a Out[7]: 1 In [8]: 'a' in get_ipython().user_ns Out[8]: True In [9]: %reset -f In [1]: 'a' in get_ipython().user_ns Out[1]: False In [2]: %reset -f in Flushing input history In [3]: %reset -f dhist in Flushing directory history Flushing input history

See also

reset_selective

invoked as %reset_selective

Aliases

  • IPython.core.magics.NamespaceMagics.reset