ipython -pylab

Hi All,

I am trying to understand exactly what the -pylab option does when I launch ipython -pylab - thought some folks here might know.

For example, after executing

ipython -pylab

I can type either

a = np.array([1.,10.])

OR

b = array([1.,10.])

are these both numpy arrays? And clearly, there has been an "import numpy as np" from the -pylab option.

Also, how is scipy imported? Just "form scipy import *" or something similar to numpy?

I haven't been able to find this info online or in documents yet.

Thanks,

Andre

Hi,

Look in IPython/Shell.py to see how pylab option is being evaluated. And similarly in matplotlib/lib/matplotlib/pylab.py

Also in your ipythonrc file you can unset pylab_import_all option to have a clearer namespace (i.e. the contents of pylab.py will not be explicitly loaded.)

And yes those are the same NumPy arrays. You can always check this by “type” builtin.

···

On Tue, Mar 9, 2010 at 6:48 PM, Andre Walker-Loud <walksloud@…287…> wrote:

Hi All,

I am trying to understand exactly what the -pylab option does when I

launch ipython -pylab - thought some folks here might know.

For example, after executing

ipython -pylab

I can type either

a = np.array([1.,10.])

OR

b = array([1.,10.])

are these both numpy arrays? And clearly, there has been an "import

numpy as np" from the -pylab option.

Also, how is scipy imported? Just “form scipy import *” or something

similar to numpy?

I haven’t been able to find this info online or in documents yet.

Thanks,

Andre


Gökhan

Also, how is scipy imported? Just "form scipy import *" or something
similar to numpy?

I haven't been able to find this info online or in documents yet.

Thanks,

Andre

Hi,

Look in IPython/Shell.py to see how pylab option is being evaluated. And similarly in matplotlib/lib/matplotlib/pylab.py

Also in your ipythonrc file you can unset pylab_import_all option to have a clearer namespace (i.e. the contents of pylab.py will not be explicitly loaded.)

And yes those are the same NumPy arrays. You can always check this by "type" builtin.

Thanks!

Andre

···

--
Gökhan