2009/1/6 Rich E :
> This helped immensely. I feel like I am getting close to being able
> to accomplish what I would like with SWIG: producing a python module
> that can be very 'python-like', while co-existing with the c library
> that is very 'c-like'.
>
> There is one question still remaining t
On Tue, Jan 6, 2009 at 22:04, Igor Sylvester wrote:
> If array fields should be of the form (name,subdtype, shape), how do I
> specify field offsets? My datatype is word-aligned.
With dtype(some_list), you need to explicitly include the padding.
E.g. ('', '|V4') to add 4 bytes of padding. Alterna
If array fields should be of the form (name,subdtype, shape), how do I
specify field offsets? My datatype is word-aligned.
Thanks.
On Tue, Jan 6, 2009 at 3:41 PM, Robert Kern wrote:
> On Tue, Jan 6, 2009 at 14:07, Igor Sylvester wrote:
> > Everyone,
> >
> > Shouldn't the itemsize below be 2?
>
This helped immensely. I feel like I am getting close to being able
to accomplish what I would like with SWIG: producing a python module
that can be very 'python-like', while co-existing with the c library
that is very 'c-like'.
There is one question still remaining though, is it possible to make
On Tue, Jan 6, 2009 at 14:07, Igor Sylvester wrote:
> Everyone,
>
> Shouldn't the itemsize below be 2?
>
import numpy as np
dtype = np.dtype( [ (((2,), 'top'), [('nested', 'i1')]) ] )
dtype.itemsize
> 1
np.__version__
> '1.0.4'
>
> The elements of the dtype are of type array of
A simpler example returns 1 as well:
np.dtype( [ (((2,), 'a'), 'i1') ] ).itemsize
On Tue, Jan 6, 2009 at 2:07 PM, Igor Sylvester wrote:
> Everyone,
>
> Shouldn't the itemsize below be 2?
>
> >>> import numpy as np
> >>> dtype = np.dtype( [ (((2,), 'top'), [('nested', 'i1')]) ] )
> >>> dtype.ite
Everyone,
Shouldn't the itemsize below be 2?
>>> import numpy as np
>>> dtype = np.dtype( [ (((2,), 'top'), [('nested', 'i1')]) ] )
>>> dtype.itemsize
1
>>> np.__version__
'1.0.4'
The elements of the dtype are of type array of size 2. Each element is a
(nested) record array of size 2 with one f
A Tuesday 06 January 2009, Franck Pommereau escrigué:
> s = {} # sum of y values for each distinct x (as keys)
> n = {} # number of summed values (same keys)
> for x, y in zip(X, Y) :
> s[x] = s.get(x, 0.0) + y
> n[x] = n.get(x, 0) + 1
Maybe this is not so bad with a couple changes?
from
Hello,
Just thinking. If the parameters are limited, you may be able to use the
histogram feature? Doing one histogram with Y as weights, then one
without weights and calculating the mean from this yourself should be
pretty speedy I imagine. Other then that maybe sorting the whole thing
and then d
Francesc Alted wrote:
> A Tuesday 06 January 2009, Franck Pommereau escrigué:
>
>> Hi all, and happy new year!
>>
>> I'm new to NumPy and searching a way to compute from a set of points
>> (x,y) the mean value of y values associated to each distinct x value.
>> Each point corresponds to a measur
On Tue, Jan 6, 2009 at 7:38 AM, Jean-Baptiste Rudant
wrote:
> Hello,
> I'm not an expert. Something exists in matplotlib, but it's not very
> efficient.
> import matplotlib.mlab
> import numpy
> N = 1000
> X = numpy.random.randint(0, 10, N)
> Y = numpy.random.random(N)
> recXY = numpy.rec.fromarr
Hello,
I'm not an expert. Something exists in matplotlib, but it's not very efficient.
import matplotlib.mlab
import numpy
N = 1000
X = numpy.random.randint(0, 10, N)
Y = numpy.random.random(N)
recXY = numpy.rec.fromarrays((X, Y), names='x, y')
summary = matplotlib..mlab.rec_groupby(recXY, ('x',
A Tuesday 06 January 2009, Franck Pommereau escrigué:
> Hi all, and happy new year!
>
> I'm new to NumPy and searching a way to compute from a set of points
> (x,y) the mean value of y values associated to each distinct x value.
> Each point corresponds to a measure in a benchmark (x = parameter,
Hi Tom
2008/11/24 Tom Wright :
> I am currently working on the Ironclad project porting numpy to Ironpython.
>
> It would be quite useful for me if HermitianTestCase in test_linalg.py
> was a new style-class instead of an old-style class - since Ironpython
> has a bug where dir operations do not w
Hi all, and happy new year!
I'm new to NumPy and searching a way to compute from a set of points
(x,y) the mean value of y values associated to each distinct x value.
Each point corresponds to a measure in a benchmark (x = parameter, y =
computation time) and I'd like to plot the graph of mean co
On Tue, Jan 6, 2009 at 03:15, Stéfan van der Walt wrote:
> Hi all,
>
> What is the exact protocol for evaluating functions like "real" and
> "imag" on object arrays?
>
> For example, I'm looking at
>
> x = np.array([np.array(3+1j), np.array(4+1j)], dtype=object)
>
> For which both
>
> In [4]: x.r
Hi all,
What is the exact protocol for evaluating functions like "real" and
"imag" on object arrays?
For example, I'm looking at
x = np.array([np.array(3+1j), np.array(4+1j)], dtype=object)
For which both
In [4]: x.real
Out[4]: array([(3+1j), (4+1j)], dtype=object)
and
In [6]: np.real(x)
Ou
17 matches
Mail list logo