bundles / IPython 9.12.0 / IPython / core / magics / namespace / NamespaceMagics / reset
function
IPython.core.magics.namespace:NamespaceMagics.reset
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
-fforce 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.
--aggressiveTry 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.
inreset input history
outreset output history
dhistreset directory history
arrayreset 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 historySee also
- reset_selective
invoked as
%reset_selective
Aliases
-
IPython.core.magics.NamespaceMagics.reset