2008/8/6 Eric Firing <[EMAIL PROTECTED]>:
> While I agree with the other posters that "import *" is not preferred,
> if you want to use it, the solution is to use amin and amax, which are
> provided precisely to avoid the conflict. Just as arange is a numpy
> analog of range, amin and amax are nu
Thanks for the encouragement to try to dive deeper into namespaces,
but also thanks for the amin, amax suggestions.
Mark
On Aug 6, 8:21 pm, Eric Firing <[EMAIL PROTECTED]> wrote:
> mark wrote:
> > Hello list. I am confused about importing numpy.
>
> > When I do
>
> > from numpy import *
>
> > and
mark wrote:
> Hello list. I am confused about importing numpy.
>
> When I do
>
> from numpy import *
>
> and I try the min function, I get the default Python min function.
>
> On the other hand, when I do
>
> import numpy as np
>
> and use the np.min function, I get the numpy min function (wh
mark wrote:
> I guess that makes sense on a certain level, but boy it is cumbersome
> to explain to a class.
> It pretty much defeats the whole purpose of doing from numpy import *.
which is fine by me:
"Namespaces are one honking great idea -- let's do more of those!"
explain namespaces to your
Anything that defeats the purpose of doing * imports is good in my book. :-)
Seriously, willy nilly import of any package into the base namespace
is just asking for trouble.
Tell your class to import numpy as np, then there will be no chance of
confusion.
Then later tell them about "from numpy i
I guess that makes sense on a certain level, but boy it is cumbersome
to explain to a class.
It pretty much defeats the whole purpose of doing from numpy import *.
Mark
On Aug 6, 12:03 pm, "Robert Kern" <[EMAIL PROTECTED]> wrote:
> On Wed, Aug 6, 2008 at 05:00, mark <[EMAIL PROTECTED]> wrote:
> >
On Wed, Aug 6, 2008 at 05:00, mark <[EMAIL PROTECTED]> wrote:
> Hello list. I am confused about importing numpy.
>
> When I do
>
> from numpy import *
>
> and I try the min function, I get the default Python min function.
>
> On the other hand, when I do
>
> import numpy as np
>
> and use the np.mi
Hello list. I am confused about importing numpy.
When I do
from numpy import *
and I try the min function, I get the default Python min function.
On the other hand, when I do
import numpy as np
and use the np.min function, I get the numpy min function (which is
obviously what I want).
I know