|
From: Benjamin R. <ben...@ou...> - 2012-11-15 20:32:23
|
On Thu, Nov 15, 2012 at 12:06 PM, Paul Hobson <pmh...@gm...> wrote: > Hey Will, > > As a user, all I can tell you is that pylab is there for convenience when: > 1) quickly and interactively exploring some new data > or > 2) making the switch over from matlab or some other numerical analysis > framework. > > In general, if you're doing some serious work -- especially work that > you might revisit at any point -- explicitly import the packages you > need into proper namespaces. As an example for me, this typically > amounts to: > > import matplotlib.pyplot as plt > import numpy as np > import scipy.stats as stats > import pandas #as pd > > I still think Will's point is valid. What likely happened (and this is me completely guessing) is that np.random.power didn't always exist. The pylab module just blindly imports these namespaces. Now, I do think that instead of np.power(), one should probably be using the "**" operator instead, but this does raise the issue of knowing when there are changes in the flatten namespace. Who's to say that something else won't collide in the future? We might need some sort of testing for this. Ben Root |