I wonder if xcorrelate would be a better name than acorrelate?
I think it would.
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
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'],
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 Jon
2009/6/3 D2Hitman j.m.gir...@warwick.ac.uk:
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
Hi all,
I posted this message couple of days ago, but gmane grouped it with an old
thread and it hasn't shown up on the front page. So here it is again...
I'd really like to see the setmember1d_nu function in ticket 1036 get into
numpy. There's a patch waiting for review that including tests:
On 2-Jun-09, at 3:06 PM, Pauli Virtanen wrote:
+0
I don't see any drawbacks, and the implementation looks good.
Thanks Pauli. I realized I was missing values() and itervalues()
(though I can't conceive of a scenario where I'd use them myself, I
guess some code might expect them). Also I
import numpy as np
x = np.array([(0.0, 1.0, 2.0, 3.0, 4.0), (1.0, 2.0, 3.0, 4.0, 5.0)],
dtype=[('a', 'f4'), ('b', 'f4'), ('c', 'f4'), ('d', 'f4'),
('e', 'f4')])
xvm = x.view(np.matrix)
xvm
matrix([[(0.0, 1.0, 2.0, 3.0, 4.0), (1.0, 2.0, 3.0, 4.0, 5.0)]],
dtype=[('a', 'f4'), ('b',
2009/6/3 Stéfan van der Walt ste...@sun.ac.za:
Hi Jon
2009/6/3 D2Hitman j.m.gir...@warwick.ac.uk:
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'] =
josef.p...@gmail.com wrote:
import numpy as np
x = np.array([(0.0, 1.0, 2.0, 3.0, 4.0), (1.0, 2.0, 3.0, 4.0, 5.0)],
dtype=[('a', 'f4'), ('b', 'f4'), ('c', 'f4'), ('d', 'f4'),
('e', 'f4')])
xvm = x.view(np.matrix)
xvm
matrix([[(0.0, 1.0, 2.0, 3.0, 4.0), (1.0, 2.0, 3.0, 4.0, 5.0)]],
On Wed, Jun 3, 2009 at 15:23, josef.p...@gmail.com wrote:
import numpy as np
x = np.array([(0.0, 1.0, 2.0, 3.0, 4.0), (1.0, 2.0, 3.0, 4.0, 5.0)],
dtype=[('a', 'f4'), ('b', 'f4'), ('c', 'f4'), ('d', 'f4'),
('e', 'f4')])
xvm = x.view(np.matrix)
xvm
matrix([[(0.0, 1.0, 2.0, 3.0, 4.0),
Wed, 03 Jun 2009 16:05:51 -0400, David Warde-Farley wrote:
On 2-Jun-09, at 3:06 PM, Pauli Virtanen wrote:
+0
I don't see any drawbacks, and the implementation looks good.
Thanks Pauli. I realized I was missing values() and itervalues() (though
I can't conceive of a scenario where I'd
On Wed, Jun 3, 2009 at 15:26, josef.p...@gmail.com wrote:
2009/6/3 Stéfan van der Walt ste...@sun.ac.za:
Hi Jon
2009/6/3 D2Hitman j.m.gir...@warwick.ac.uk:
I understand record arrays such as:
a_array =
On Wed, Jun 3, 2009 at 4:58 PM, Robert Kern robert.k...@gmail.com wrote:
On Wed, Jun 3, 2009 at 15:23, josef.p...@gmail.com wrote:
import numpy as np
x = np.array([(0.0, 1.0, 2.0, 3.0, 4.0), (1.0, 2.0, 3.0, 4.0, 5.0)],
dtype=[('a', 'f4'), ('b', 'f4'), ('c', 'f4'), ('d', 'f4'),
('e',
On Wed, Jun 3, 2009 at 16:06, josef.p...@gmail.com wrote:
On Wed, Jun 3, 2009 at 4:58 PM, Robert Kern robert.k...@gmail.com wrote:
On Wed, Jun 3, 2009 at 15:23, josef.p...@gmail.com wrote:
import numpy as np
x = np.array([(0.0, 1.0, 2.0, 3.0, 4.0), (1.0, 2.0, 3.0, 4.0, 5.0)],
josef.p...@gmail.com wrote:
Ok, I didn't know numpy can have structured matrices,
well, matrices are a subclass of nd-arrays, so they support it, but it's
probably not the least bit useful.
See my earlier post to see how to do what I think you want.
You may not want a matrix anyway -- a 2-d
On Wed, Jun 3, 2009 at 5:18 PM, Christopher Barker
chris.bar...@noaa.gov wrote:
josef.p...@gmail.com wrote:
Ok, I didn't know numpy can have structured matrices,
well, matrices are a subclass of nd-arrays, so they support it, but it's
probably not the least bit useful.
See my earlier post
josef.p...@gmail.com wrote:
I'm very happy with plain numpy arrays, but to handle different data
types in scipy.stats, I'm still trying to figure out how views and
structured arrays work. And I'm still confused.
OK, I'd stay away from matrix then, no need to add that confusion
From the use
On Wed, Jun 3, 2009 at 16:31, josef.p...@gmail.com wrote:
On Wed, Jun 3, 2009 at 5:18 PM, Christopher Barker
chris.bar...@noaa.gov wrote:
josef.p...@gmail.com wrote:
Ok, I didn't know numpy can have structured matrices,
well, matrices are a subclass of nd-arrays, so they support it, but
On Wed, Jun 3, 2009 at 5:57 PM, Christopher Barker
chris.bar...@noaa.gov wrote:
josef.p...@gmail.com wrote:
I'm very happy with plain numpy arrays, but to handle different data
types in scipy.stats, I'm still trying to figure out how views and
structured arrays work. And I'm still confused.
2009/6/3 Robert Kern robert.k...@gmail.com:
On Wed, Jun 3, 2009 at 16:31, josef.p...@gmail.com wrote:
I'm very happy with plain numpy arrays, but to handle different data
types in scipy.stats, I'm still trying to figure out how views and
structured arrays work. And I'm still confused.
On Wed, Jun 3, 2009 at 17:53, josef.p...@gmail.com wrote:
Is len(z.dtype) 0 the best way to find out whether an array has a
structured dtype?
(z.dtype.names is not None) is better.
--
Robert Kern
I have come to believe that the whole world is an enigma, a harmless
enigma that is made
On Wed, Jun 3, 2009 at 5:55 PM, Robert Kern robert.k...@gmail.com wrote:
On Wed, Jun 3, 2009 at 16:31, josef.p...@gmail.com wrote:
On Wed, Jun 3, 2009 at 5:18 PM, Christopher Barker
chris.bar...@noaa.gov wrote:
josef.p...@gmail.com wrote:
Ok, I didn't know numpy can have structured matrices,
On Wed, Jun 3, 2009 at 17:58, josef.p...@gmail.com wrote:
Do you have an opinion about whether .view(ndarray_subclass) or
__array_wrap__ is the more appropriate return wrapper for function
such as the ones in stats?
__array_wrap__ would be more appropriate. It's what ufuncs use.
--
Robert
On Jun 3, 2009, at 5:03 PM, Robert Kern wrote:
On Wed, Jun 3, 2009 at 15:26, josef.p...@gmail.com wrote:
2009/6/3 Stéfan van der Walt ste...@sun.ac.za:
Hi Jon
2009/6/3 D2Hitman j.m.gir...@warwick.ac.uk:
I understand record arrays such as:
a_array =
On Jun 3, 2009, at 7:00 PM, Robert Kern wrote:
On Wed, Jun 3, 2009 at 17:58, josef.p...@gmail.com wrote:
Do you have an opinion about whether .view(ndarray_subclass) or
__array_wrap__ is the more appropriate return wrapper for function
such as the ones in stats?
__array_wrap__ would be
On Wed, Jun 3, 2009 at 18:20, Pierre GM pgmdevl...@gmail.com wrote:
On Jun 3, 2009, at 5:03 PM, Robert Kern wrote:
On Wed, Jun 3, 2009 at 15:26, josef.p...@gmail.com wrote:
2009/6/3 Stéfan van der Walt ste...@sun.ac.za:
Hi Jon
2009/6/3 D2Hitman j.m.gir...@warwick.ac.uk:
I understand
On Wed, Jun 3, 2009 at 7:21 PM, Pierre GM pgmdevl...@gmail.com wrote:
On Jun 3, 2009, at 7:00 PM, Robert Kern wrote:
On Wed, Jun 3, 2009 at 17:58, josef.p...@gmail.com wrote:
Do you have an opinion about whether .view(ndarray_subclass) or
__array_wrap__ is the more appropriate return
On Jun 3, 2009, at 7:23 PM, Robert Kern wrote:
On Wed, Jun 3, 2009 at 18:20, Pierre GM pgmdevl...@gmail.com 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 7:33 PM, Pierre GM pgmdevl...@gmail.com wrote:
On Jun 3, 2009, at 7:23 PM, Robert Kern wrote:
On Wed, Jun 3, 2009 at 18:20, Pierre GM pgmdevl...@gmail.com wrote:
Or, as all fields have the same dtype:
a_array.view(dtype=('f',len(a_array.dtype)))
array([[ 0., 1.,
On Wed, Jun 3, 2009 at 7:56 PM, josef.p...@gmail.com wrote:
On Wed, Jun 3, 2009 at 7:33 PM, Pierre GM pgmdevl...@gmail.com wrote:
On Jun 3, 2009, at 7:23 PM, Robert Kern wrote:
On Wed, Jun 3, 2009 at 18:20, Pierre GM pgmdevl...@gmail.com wrote:
Or, as all fields have the same dtype:
Hi, I want to extract elements of an array (say, a) that are contained in
another array (say, b). That is, if a=array([1,1,2,3,3,4]), b=array([1,4]),
then I want array([1,1,4]).
I did the following but the speed is very slow (maybe because a is very
long):
c=array([])
for x in b:
On Wed, Jun 3, 2009 at 8:25 PM, josef.p...@gmail.com wrote:
On Wed, Jun 3, 2009 at 7:56 PM, josef.p...@gmail.com wrote:
On Wed, Jun 3, 2009 at 7:33 PM, Pierre GM pgmdevl...@gmail.com wrote:
On Jun 3, 2009, at 7:23 PM, Robert Kern wrote:
On Wed, Jun 3, 2009 at 18:20, Pierre GM
On Wed, Jun 3, 2009 at 8:29 PM, Ning Sean nings...@gmail.com wrote:
Hi, I want to extract elements of an array (say, a) that are contained in
another array (say, b). That is, if a=array([1,1,2,3,3,4]), b=array([1,4]),
then I want array([1,1,4]).
I did the following but the speed is very slow
On 3-Jun-09, at 5:01 PM, Pauli Virtanen wrote:
Btw, are you able to change the status of the ticket to
needs_review?
I think this should be possible for everyone, and not restricted to
admins, but I'm not 100% sure...
Sorry, yes I am. I had just forgotten.
David
Thanks! Tried it and it is about twice as fast as my approach.
-Ning
On Wed, Jun 3, 2009 at 7:45 PM, josef.p...@gmail.com wrote:
On Wed, Jun 3, 2009 at 8:29 PM, Ning Sean nings...@gmail.com wrote:
Hi, I want to extract elements of an array (say, a) that are contained in
another array (say,
35 matches
Mail list logo