> how can I pick up something like:
> array([[1, 2, 3, 4],
> [6, 7, 8, 9]])
I'm not sure to understand, should not a[:,1:] be sufficient ?
Did I miss something in your message ?
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http:
What about
a=arange(len(v))
w=u[v,a]
?
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
> Any other ideas?
I'm not an expert at all, but I far as I understand if you cannot
vectorize your problem, numpy is not the best tool to use if the speed
matter a bit.
Of course it's not a realistic example, but a simple loop computing a
cosine is 3-4 time slower using numpy cos than python
Le 26/11/2010 17:48, Bruce Sherwood a écrit :
> Although this was mentioned earlier, it's worth emphasizing that if
> you need to use functions such as cosine with scalar arguments, you
> should use math.cos(), not numpy.cos(). The numpy versions of these
> functions are optimized for handling arra
Le 25/11/2010 11:51, Ernest Adrogué a écrit :
> I'm not an expert either, but the basic idea you have to get is
> that "for" loops in Python are slow. Numpy is not going to change
> this. Instead, Numpy allows you to work with "vectors" and "arrays"
> so that you need not putting loops in your code
Le 25/11/2010 11:38, Sebastian Walter a écrit :
> using math.cos instead of numpy.cos should be much faster.
> I believe this is a known issue of numpy.
You're right, with math.cos, the code take 4.3s to run, not as fast as
IDL, but a lot better.
___
Nu
Hello all,
I have a little question about the speed of numpy vs IDL 7.0. I did a
very simple little check by computing just a cosine in a loop. I was
quite surprised to see an order of magnitude of difference between numpy
and IDL, I would have thought that for such a basic function, the speed
> Dave, I got:
> c:\SVNRepository\numpy>C:\Python31>python setup.py bdist_wininst
> 'C:\Python31' is not recognized as an internal or external command,
> operable program or batch file.
I shouldn't type "C:\Python31>python setup.py bdist_wininst". but python
setup.py bdist_wininst
You might have
> Now what? "Try simple commands"? Like "Lemme outta here!"?
I don't want to afraid you, but if you're not comfortable with command
line and numpy installation you should better wait for a binary release
and stick to the 2.X version until.
J.L.
___
N
thanks to everybody
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Hello all,
If if define 2 variables a and b by doing the following :
on [5]: a
Out[5]: array([ 1.7])
In [6]: b=array([0.8])+array([0.9])
In [7]: b
Out[7]: array([ 1.7])
if I test the equality of a and b, instead to obatin True, I have :
In [8]: a==b
Out[8]: array([False], dtype=bool)
I kno
11 matches
Mail list logo