Hi numpy-users
I have a 2d array of shape (ny, nx). I want to broadcast (copy) this
array to a target array of shape (nt, nz, ny, nz) or (nt, ny, nx) so
that the 2d array is repeated for each t and z index (corresponding to
nt and nz). I am not sure how to do this (generic solution, for
different
subclassed MA but that might be an alternative solution:
"""
Compressed array. A compressed array is an alternative to numpy
masked arrays designed to reduce memory consumption.
Jesper Larsen, 2010
"""
# External imports
import numpy as np
def _compress(arr):
&q
Hi people,
I was wondering about the status of using the standard library
multiprocessing module with numpy. I found a cookbook example last
updated one year ago which states that:
"This page was obsolete as multiprocessing's internals have changed.
More information will come shortly; a link to t
Hi numpy people,
I have a problem with array broadcasting for object arrays and list. I
would like to create a numpy array containing empty lists (initially -
I will append to them later):
import numpy as npy
a = npy.empty((2), dtype=npy.object_)
# Works fine:
for i in range(len(a)):
a[i] = []
Hi Pierre and others,
On Monday 25 June 2007 15:37, Pierre GM wrote:
> On Monday 25 June 2007 05:12:01 Jesper Larsen wrote:
> > myarray.mask[i] = True
>
> Mmh. Experience shows that directly accessing the mask can lead to bad
> surprises. To mask a series of values in an array
Hi numpy users,
I have a masked array. I am looping over the elements of this array and
sometimes want to set a value to missing. Normally this can be done by:
myarray.mask[i] = True
However the mask attribute is not indexable when there are no existing missing
values in the array (it is simpl
On Wednesday 30 May 2007 19:48, Robert Kern wrote:
> I'm afraid this doesn't work, either. Correlation matrices are constrained
> to be positive semidefinite; that is, all of their eigenvalues must be >=
> 0. Calculating each of the correlation coefficients in a pairwise fashion
> doesn't incorpora
On Friday 25 May 2007 19:18, Robert Kern wrote:
> Jesper Larsen wrote:
> > Hi numpy users,
> >
> > I have a masked array of dimension (nvariables, nobservations) that
> > contain missing values at arbitrary points. Is it safe to rely on
> > numpy.corrcoeff to calcu
Hi numpy users,
I have a masked array of dimension (nvariables, nobservations) that contain
missing values at arbitrary points. Is it safe to rely on numpy.corrcoeff to
calculate the correlation coefficients of a masked array (it seems to give
reasonable results)?
Cheers,
Jesper
__