[IPython-dev] --pylab flag deprecated
Wed Mar 5 09:07:42 CST 2014
the recommended approach, that will make in the long run your notebooks
more readable, is to use
import numpy as np
import matplotlib.pyplot as plt
atop your notebooks. That will make it easier to know what comes from
where. Now, if you *really* want to have a lot of top-level plotting and
numerical functions, and are willing to pay the price that for example
doing a lot of automatic imports clobbers the built-in python sum()
function with numpy.sum() (which can cause some surprises), you can still do
at the top. We will probably never remove this, partly because it's still
useful for *quick and dirty* analysis where you just want to do something
fast with minimal overhead, and is mostly throw-away scratch work. This
kind of typing economy is also still very useful at the console.
But in the long run, our experience is that notebooks tend to linger for a
long time: in that scenario, it's worth paying the price of slightly more
verbose code with explicit imports, in order to reap the benefits of
readability in the long run.
On Wed, Mar 5, 2014 at 4:05 AM, Vasco Tenner <email@example.com> wrote:
> I used to start ipython notebook with the --pylab flag, so I have all
> kinds of usefull functions directly available. By guessing and
> tab-completion many usefull functions, for data analysis popped up.
> (like plot, display etc).
> Now the --pylab flag will deprecate soon, what is the best alternative
> for an interactive environment. I already found it usefull to import
> from pylab:
> from pylab import *
> However, the --pylab flag did more: it also loaded a bunch of ipython
> functions, like IPython.display.display.
> Is there a preffered way to load this? To configure this in some
> I just found the
> magic. Should I put this in the top cell of all my notebooks? What
> should I advice to my starting collegues?
> IPython-dev mailing list
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev