Hi all,
Likely a very newbie type of question. I'm using numpy with GDAL to calculate
zonal statistics on images. The basic approach is that I have a zone raster
and a value raster which are aligned spatially and I am storing each zone's
corresponding values in a dictionary, then calculating
Hi all,
I'm trying to calculate accumulated sum-of-squared-differences for an array in
the following manner:
import numpy as np
a = np.array([1, 2, 3, 49., 50, 51, 98, 99, 100], dtype=np.float32)
# Calculate accumulated means over all elements
means = np.add.accumulate(a) / (np.arange(a.size) +
Apologies for what is likely a simple question and I hope it hasn't been asked
before ...
Given a recarray with a dtype consisting of more than one type, e.g.
>>> import numpy as n
>>> a = n.array([(1.0, 2), (3.0, 4)], dtype=[('x', float), ('y', int)])
>>> b = a.view(n.recarray)
>>> b
Eads, Damian wrote:
> You may need to be a bit more specific by what you mean by
> weighted majority. What are the range of values for values
> and weights, specifically? This sounds a lot like pixel
> classification where each pixel is classified with a majority
> vote over its weights and val
Hi list,
I'm a definite newbie to numpy, but finding the library to be incredibly
useful.
I'm trying to calculate a weighted majority using numpy functions. I
have two sets of image stacks (one is values, the other weights) that I
read into 3D numpy arrays. Assuming I read in a 100 row x 100 co