Nevermind, I just found http://bugs.python.org/issue1675423 .
On Jul 9, 2009, at 1:41 AM, Robert Bradshaw wrote:
I know using __complex__ has been discussed before, but it would be
really nice if it were at least used to convert object to the
complex dtypes.
- Robert
In [1]: class
Here is a different one, based on the ZCW (Zaremba, Conroy,
Wolfsberg) algorithm used for powder spectra to equally distribute
points over a sphere surface:
This paper gives an nice overview (I think I took the actual algorithm
from there):
Computer simulations in solid-state NMR. III.
On 10-Jul-09, at 1:25 AM, Chris Colbert wrote:
actually what would be better is if i can pass two 1d arrays X and Y
both size Nx1
and get back a 2d array of size NxM where the [n,:] row is the linear
interpolation of X[n] to Y[n]
This could be more efficient, but here's a solution using
Can someone explain:
x = np.arange(20)
y = np.arange(20)
z = np.vstack((x,y)).T
is equal to:
z = np.column_stack((x,y))
but this does not do the same:
z = np.concatenate((x,y),axis=0) # or with axis=1
Seems I should be able to use concatenate to make a column stack??
Thanks!
--
View
hey,
great man! thanks!
I had thought that it may have been possible with a single dot, but
how to do it escaped me.
Thanks again!
Chris
Hi,
When dot is not what you want, often numpy.inner() and numpy.outer() do
what you want.
So try using numpy.inner(x,y)...
Oh cool, I couldn't figure out with mgrid.
here's what ended up with using broadcasting:
import numpy as np
X = np.zeros((10))
Y = np.arange(10, 20)
M = 10
increments = np.arange(1, M+1)
delta = Y - X
dl = (delta / M).reshape(-1, 1)
interps = dl * increments
lines = X + interps
lines
Hello,
I happened to have a look at the code for np.diag
and found it more complicated that necessary.
I think it can be rewritten more cleanly and
efficiently.
Appended you can find both versions.
The speed improvement is significant:
In [145]: x = S.rand(1000,1300)
In [146]: assert
Fri, 10 Jul 2009 15:55:58 +0100, Citi, Luca kirjoitti:
[clip]
## SUGGESTED
def diag(v, k=0):
v = asarray(v)
s = v.shape
if len(s) == 1:
[clip]
elif len(s) == 2:
if v.flags.f_contiguous:
v, k, s = v.T, -k, s[::-1]
Is this correct? The .flat iterator
The current dmg on the numpy download pages is buildt against 2.5. Is
there any plans
to make one for 2.6 or do I have to compile from the source?
Cheers
Tommy
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
if v.flags.f_contiguous:
v, k, s = v.T, -k, s[::-1]
Is this correct? The .flat iterator always traverses the array in virtual
C-order, not in the order it's laid out in memory.
The code could work (and gives the same results) even
without the two lines above which in
On Fri, Jul 10, 2009 at 07:40, John [H2O]washa...@gmail.com wrote:
Can someone explain:
x = np.arange(20)
y = np.arange(20)
z = np.vstack((x,y)).T
is equal to:
z = np.column_stack((x,y))
but this does not do the same:
z = np.concatenate((x,y),axis=0) # or with axis=1
Seems I
Can you do it by chunk instead of by row? If the chunk is not too big the
sort could be faster then the access to the multiple dictionnary access. But
don't forget, you change an algo of O(n), by O(nlogn) with a lower constant.
So the n should not be too big. Just try different value.
Frédéric
On 10-Jul-09, at 1:26 PM, David Goldsmith wrote:
grid = np.array([np.linspace(x[i],y[i],nrows) for i in
range(len(x))]).T
Indeed, linspace will work, but careful with Python loops though,
it'll be 2x to 6x slower (based on my empirical fiddling) than the
solution involving mgrid.
In
Touche.
DG
--- On Fri, 7/10/09, David Warde-Farley d...@cs.toronto.edu wrote:
From: David Warde-Farley d...@cs.toronto.edu
Subject: Re: [Numpy-discussion] an np.arange for arrays?
To: Discussion of Numerical Python numpy-discussion@scipy.org
Date: Friday, July 10, 2009, 1:06 PM
On
These are all great algorithms, thanks for the help!
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Fri, Jul 10, 2009 at 3:52 AM, Robert
Bradshawrober...@math.washington.edu wrote:
Nevermind, I just found http://bugs.python.org/issue1675423 .
Nevermind? Perhaps NumPy should handle this gotcha for Python 2.6 ?
-
On Jul 9, 2009, at 1:41 AM, Robert Bradshaw wrote:
I know using
On Sat, Jul 11, 2009 at 12:19 AM, Tommy Gravtg...@mac.com wrote:
The current dmg on the numpy download pages is buildt against 2.5. Is
there any plans
to make one for 2.6 or do I have to compile from the source?
There are plans :) I am building the 0.7.1 binaries right now, and mac
os x
Hey Frederic:
thanks for the response. I really want it to do it your way but I am
a bad programmer. Do you have any sample code? your method seems
correct
2009/7/10 Frédéric Bastien no...@nouiz.org:
Can you do it by chunk instead of by row? If the chunk is not too big the
sort could be
18 matches
Mail list logo