Advertisement
Guest User

locals filtering

a guest
Feb 22nd, 2014
1,966
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.34 KB | None | 0 0
  1. In [1]: import debug_nice
  2. In [2]: len(debug_nice.debug_nice(locals()))
  3. Out[2]: 5
  4. In [3]: from pandas import *; from numpy import *
  5. In [4]: len(locals())
  6. Out[4]: 698
  7. In [5]: len(debug_nice.debug_nice(locals()))
  8. Out[5]: 151
  9. In [6]: keys = ['typeNA', 'typeDict', 'sctypes', 'sctypeNA', 'typecodes', 'sctypeDict', 'typeCodes', 'ScalarType', 'nbytes', 'cast', 'In', 'Out', 'keys', 'get_ipython']
  10. Out [6]:
  11. In [7]: keys.extend( {k: v for k, v in locals().iteritems() if type(v) == type(sign)}.keys())
  12. Out [7]:
  13. In[8]:
  14. In [9]: debug_nice.debug_nice(locals(), keys=keys)
  15. Out[9]:
  16. {'ALLOW_THREADS': 1,
  17.  'BUFSIZE': 8192,
  18.  'CLIP': 0,
  19.  'ERR_CALL': 3,
  20.  'ERR_DEFAULT': 0,
  21.  'ERR_DEFAULT2': 521,
  22.  'ERR_IGNORE': 0,
  23.  'ERR_LOG': 5,
  24.  'ERR_PRINT': 4,
  25.  'ERR_RAISE': 2,
  26.  'ERR_WARN': 1,
  27.  'FLOATING_POINT_SUPPORT': 1,
  28.  'FPE_DIVIDEBYZERO': 1,
  29.  'FPE_INVALID': 8,
  30.  'FPE_OVERFLOW': 2,
  31.  'FPE_UNDERFLOW': 4,
  32.  'False_': False,
  33.  'Inf': inf,
  34.  'Infinity': inf,
  35.  'MAXDIMS': 32,
  36.  'NAN': nan,
  37.  'NINF': -inf,
  38.  'NZERO': -0.0,
  39.  'NaN': nan,
  40.  'NaT': NaT,
  41.  'PINF': inf,
  42.  'PZERO': 0.0,
  43.  'RAISE': 2,
  44.  'SHIFT_DIVIDEBYZERO': 0,
  45.  'SHIFT_INVALID': 9,
  46.  'SHIFT_OVERFLOW': 3,
  47.  'SHIFT_UNDERFLOW': 6,
  48.  'True_': True,
  49.  'UFUNC_BUFSIZE_DEFAULT': 8192,
  50.  'UFUNC_PYVALS_NAME': 'UFUNC_PYVALS',
  51.  'WRAP': 1,
  52.  'c_': <numpy.lib.index_tricks.CClass at 0x102925390>,
  53.  'describe_option': <pandas.core.config.CallableDynamicDoc at 0x102e232d0>,
  54.  'e': 2.718281828459045,
  55.  'exit': <IPython.core.autocall.ExitAutocall at 0x101e7d5d0>,
  56.  'format_parser': numpy.core.records.format_parser,
  57.  'get_option': <pandas.core.config.CallableDynamicDoc at 0x102e23210>,
  58.  'help': Type help() for interactive help, or help(object) for help about object.,
  59.  'index_exp': <numpy.lib.index_tricks.IndexExpression at 0x102925410>,
  60.  'inf': inf,
  61.  'infty': inf,
  62.  'little_endian': True,
  63.  'mgrid': <numpy.lib.index_tricks.nd_grid at 0x1029252d0>,
  64.  'nan': nan,
  65.  'newaxis': None,
  66.  'ogrid': <numpy.lib.index_tricks.nd_grid at 0x102925310>,
  67.  'options': <pandas.core.config.DictWrapper at 0x102e23310>,
  68.  'pi': 3.141592653589793,
  69.  'plot_params': {'xaxis.compat': False},
  70.  'r_': <numpy.lib.index_tricks.RClass at 0x102925350>,
  71.  'reset_option': <pandas.core.config.CallableDynamicDoc at 0x102e23290>,
  72.  's_': <numpy.lib.index_tricks.IndexExpression at 0x102925490>,
  73.  'set_option': <pandas.core.config.CallableDynamicDoc at 0x102e23250>}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement