On Thu, Jun 4, 2009 at 12:28 PM, Pierre GM wrote:
> I foresee serious disturbance in the force...
> When I use structured arrays, each field usually represents a
> different variable, and I may not be keen on having a same operation
> applied to all variables. At least, the current behavior (raise
On Jun 4, 2009, at 3:12 PM, Fernando Perez wrote:
> Howdy,
> I was thinking about this yesterday, because I'm dealing with exactly
> this same problem in a local project. How hard would it be to allow
> structured arrays to support ufuncs/arithmetic for the case where
> their dtype is actually
Howdy,
2009/6/3 Stéfan van der Walt :
>> however i seem to lose simple operations such as multiplication (a_array*2)
>> or powers (a_array**2).
>
> As a workaround, you can have two views on your data:
I was thinking about this yesterday, because I'm dealing with exactly
this same problem in a l
On Wed, Jun 3, 2009 at 8:25 PM, wrote:
> On Wed, Jun 3, 2009 at 7:56 PM, wrote:
>> On Wed, Jun 3, 2009 at 7:33 PM, Pierre GM wrote:
>>>
>>> On Jun 3, 2009, at 7:23 PM, Robert Kern wrote:
>>>
On Wed, Jun 3, 2009 at 18:20, Pierre GM wrote:
>
>
> Or, as all fields have the same
On Wed, Jun 3, 2009 at 7:56 PM, wrote:
> On Wed, Jun 3, 2009 at 7:33 PM, Pierre GM wrote:
>>
>> On Jun 3, 2009, at 7:23 PM, Robert Kern wrote:
>>
>>> On Wed, Jun 3, 2009 at 18:20, Pierre GM wrote:
Or, as all fields have the same dtype:
>>> a_array.view(dtype=('f',len(a
On Wed, Jun 3, 2009 at 7:33 PM, Pierre GM wrote:
>
> On Jun 3, 2009, at 7:23 PM, Robert Kern wrote:
>
>> On Wed, Jun 3, 2009 at 18:20, Pierre GM wrote:
>>>
>>>
>>> Or, as all fields have the same dtype:
>>>
>>> >>> a_array.view(dtype=('f',len(a_array.dtype)))
>>> array([[ 0., 1., 2., 3., 4.]
On Jun 3, 2009, at 7:23 PM, Robert Kern wrote:
> On Wed, Jun 3, 2009 at 18:20, Pierre GM wrote:
>>
>>
>> Or, as all fields have the same dtype:
>>
>> >>> a_array.view(dtype=('f',len(a_array.dtype)))
>> array([[ 0., 1., 2., 3., 4.],
>>[ 1., 2., 3., 4., 5.]], dtype=float32)
>>
>>
On Wed, Jun 3, 2009 at 18:20, Pierre GM wrote:
>
> On Jun 3, 2009, at 5:03 PM, Robert Kern wrote:
>
>> On Wed, Jun 3, 2009 at 15:26, wrote:
>>> 2009/6/3 Stéfan van der Walt :
Hi Jon
2009/6/3 D2Hitman :
> I understand record arrays such as:
> a_array =
> np.array([(0.,1
On Jun 3, 2009, at 5:03 PM, Robert Kern wrote:
> On Wed, Jun 3, 2009 at 15:26, wrote:
>> 2009/6/3 Stéfan van der Walt :
>>> Hi Jon
>>>
>>> 2009/6/3 D2Hitman :
I understand record arrays such as:
a_array =
np.array([(0.,1.,2.,3.,4.),(1.,2.,3.,4.,5.)],dtype=[('a','f'),
('b','
On Wed, Jun 3, 2009 at 15:26, wrote:
> 2009/6/3 Stéfan van der Walt :
>> Hi Jon
>>
>> 2009/6/3 D2Hitman :
>>> I understand record arrays such as:
>>> a_array =
>>> np.array([(0.,1.,2.,3.,4.),(1.,2.,3.,4.,5.)],dtype=[('a','f'),('b','f'),('c','f'),('d','f'),('e','f')])
>>> do this with field names.
2009/6/3 Stéfan van der Walt :
> Hi Jon
>
> 2009/6/3 D2Hitman :
>> I understand record arrays such as:
>> a_array =
>> np.array([(0.,1.,2.,3.,4.),(1.,2.,3.,4.,5.)],dtype=[('a','f'),('b','f'),('c','f'),('d','f'),('e','f')])
>> do this with field names.
>> a_array['a'] = array([ 0., 1.], dtype=float
Hi Jon
2009/6/3 D2Hitman :
> I understand record arrays such as:
> a_array =
> np.array([(0.,1.,2.,3.,4.),(1.,2.,3.,4.,5.)],dtype=[('a','f'),('b','f'),('c','f'),('d','f'),('e','f')])
> do this with field names.
> a_array['a'] = array([ 0., 1.], dtype=float32)
> however i seem to lose simple opera
On Jun 3, 2009, at 11:06 AM, D2Hitman wrote:
>
> Hi,
>
> I would like to have an object/class that acts like array of floats
> such as:
> a_array = numpy.array([[0.,1.,2.,3.,4.],[1.,2.,3.,4.,5.]])
> but i would like to be able to slice this array by some header
> dictionary:
> header_dict = {
Hi,
I would like to have an object/class that acts like array of floats such as:
a_array = numpy.array([[0.,1.,2.,3.,4.],[1.,2.,3.,4.,5.]])
but i would like to be able to slice this array by some header dictionary:
header_dict = {'a':0,'b':1,'c':2,'d':3,'e':4}
such that i could use a_array['a'],
14 matches
Mail list logo