[IPython-User] Numpy polluting the notebook namespace?

Junkshops junkshops@gmail....
Fri Jul 27 14:34:24 CDT 2012


>
> Are you sure that you're not telling IPython to do that in your config 
> files? For example, you might have the pylab value set in 
> your ipython_notebook_config.py:
>
>      c.IPKernelApp.pylab = 'inline'
That's the problem - I start the notebook server with the --pylab=inline 
option to allow for matplotlib graphics to show up inline as per the 
documentation: 
http://ipython.org/ipython-doc/stable/interactive/htmlnotebook.html

I don't understand what the option does other than that, so I didn't 
realize that it came with side effects like those below. I don't suppose 
there's any way to set the notebook up so plots are displayed inline 
without masking the builtin functions? If not, would

any = __builtins__.any
all = __builtins__.all

possibly break the inline plotting?

Cheers, g


On 7/27/2012 11:48 AM, Tony Yu wrote:
>
>
> On Fri, Jul 27, 2012 at 2:37 PM, Junkshops <junkshops@gmail.com 
> <mailto:junkshops@gmail.com>> wrote:
>
>     -bash-4.1$ python
>     Python 2.6.6 (r266:84292, Jun 18 2012, 14:18:47)
>     [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
>     Type "help", "copyright", "credits" or "license" for more information.
>     >>> any
>     <built-in function any>
>     >>> all
>     <built-in function all>
>
>     -bash-4.1$ ipython
>     Python 2.6.6 (r266:84292, Jun 18 2012, 14:18:47)
>     Type "copyright", "credits" or "license" for more information.
>
>     IPython 0.13 -- An enhanced Interactive Python.
>     *snip*
>
>     In [1]: any
>     Out[1]: <function any>
>
>     In [2]: all
>     Out[2]: <function all>
>
>     In a new notebook:
>     In [1]: any
>
>     Out[1]: <function numpy.core.fromnumeric.any>
>
>     In [2]: all
>
>     Out[2]: <function numpy.core.fromnumeric.all>
>
>     For some reason the builtins are masked by the numpy functions
>     even when
>     numpy isn't explicitly imported.
>
>     -g
>
>
> Are you sure that you're not telling IPython to do that in your config 
> files? For example, you might have the pylab value set in 
> your ipython_notebook_config.py:
>
>      c.IPKernelApp.pylab = 'inline'
>
> -Tony
>
>
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120727/b2c3cf2a/attachment.html 


More information about the IPython-User mailing list