On Tue, 2 Oct 2007, Charles R Harris apparently wrote:
> We're avoiding consolidated fields because they behave
> badly. ... The main problem with the consolidated fields
> is that they are all put together as item lists in
> a definition list and moved to the end of the docstring
> when it is
Edson Tadeu wrote:
> For now, I solved it using a view with a different type:
>
> from numpy import *
> N = 5
> a=zeros(N,'3f8')
> b=a.view()
> b.dtype='f8'
> b.shape = N,3
Note that this doesn't quite do what you want. I was wrong about the dtype='3f8'
syntax: it just gives you a regular float
For now, I solved it using a view with a different type:
from numpy import *
N = 5
a=zeros(N,'3f8')
b=a.view()
b.dtype='f8'
b.shape = N,3
I'll try to put this mechanism in a subclass.
Thanks for the answers,
Edson
On 10/4/07, Stefan van der Walt <[EMAIL PROTECTED]> wrote:
>
> On Thu, Oct 0
On Thursday 04 October 2007 13:08:08 David M. Cooke wrote:
> Alan G Isaac <[EMAIL PROTECTED]> writes:
> > To help me understand, might someone offer some examples of
> > NumPy names that really should be changed?
>
> Internal classes, like:
> - masked_unary_operation, etc. in numpy/core/ma.py
FYI,
On Thu, Oct 04, 2007 at 11:47:40AM -0500, Robert Kern wrote:
> Edson Tadeu wrote:
>
> > * Is there any field in the NumPy object where I can keep this
> > information (the shape of the "element"), without creeping it with the
> > dtype='(M,N)f8' representation I explained above?
>
> There isn't.
Alan G Isaac <[EMAIL PROTECTED]> writes:
> To help me understand, might someone offer some examples of
> NumPy names that really should be changed?
Internal classes, like:
- nd_grid, etc. in numpy/lib/index_tricks.py
- masked_unary_operation, etc. in numpy/core/ma.py
Things we probably wouldn't
Edson Tadeu wrote:
> * Is there any field in the NumPy object where I can keep this
> information (the shape of the "element"), without creeping it with the
> dtype='(M,N)f8' representation I explained above?
There isn't. You could make a subclass that tracks this, but you would have to
implement
Alan G Isaac wrote:
> On Thu, 4 Oct 2007, Edson Tadeu apparently wrote:
>> Is there any field in the NumPy object where I can keep
>> this information (the shape of the "element"), without
>> creeping it with the dtype='(M,N)f8'
>> representation I explained above?
>
> Perhaps you want a recarr
On Thu, 4 Oct 2007, Edson Tadeu apparently wrote:
> Is there any field in the NumPy object where I can keep
> this information (the shape of the "element"), without
> creeping it with the dtype='(M,N)f8'
> representation I explained above?
Perhaps you want a recarray?
Cheers,
Alan Isaac
___
I've found that there are two ways to represent an array of 3D points:
# 01:
N = 4
a = numpy.zeros((N, 3), dtype='f8')
# 02:
N = 4
b = numpy.zeros(N, dtype='3f8')
The second representation seems "conceptually" better, it is really an 1D
array of N elements ( i.e., b.shape == (4,) ), but, "in
Hi Donald
On Thu, Oct 04, 2007 at 01:48:18AM +, Donald Fredkin wrote:
> It appears that something peculiar is going on with the numpy function
> trace(). The docs say that trace(A,...) is identical to A.trace(...).
> Here is a test:
>
> A = arange(8).reshape((2,2,2))
> A.trace(0,1,2)
> #[Out]
11 matches
Mail list logo