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 :
> Can you do it by chunk instead of by row? If the chunk is not too big the
> sort could be faster then the ac
On Sat, Jul 11, 2009 at 12:19 AM, Tommy Grav 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 binaries will be
On Fri, Jul 10, 2009 at 3:52 AM, Robert
Bradshaw 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 __complex__ has been discussed
Touche.
DG
--- On Fri, 7/10/09, David Warde-Farley wrote:
> From: David Warde-Farley
> Subject: Re: [Numpy-discussion] an np.arange for arrays?
> To: "Discussion of Numerical Python"
> Date: Friday, July 10, 2009, 1:06 PM
> On 10-Jul-09, at 1:26 PM, David
> Goldsmith wrote:
>
> > grid = np.
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 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 [3
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 Bas
It's also 5 LOSC using linspace:
def interp_grid(x, y, nrows):
''' A linearly-interpolated (across rows) 2-D grid generator '''
## Put data quality checking here - confirm len(x) == len(y),
## nrows > 2, decide on behavior if inputs bad
ncols = len(x)
grid = np.zeros((nrows, ncols)) # al
On Fri, Jul 10, 2009 at 07:40, John [H2O] 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 should
>> 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
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
http://mail.scipy.org/mail
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 iterat
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 all(diag(x,-1
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
>>> lin
>
> 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)...
http://ww
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 this
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
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. Powd
18 matches
Mail list logo