Re: [Numpy-discussion] Concatenating string arrays

2009-03-18 Thread Thomas Robitaille
>> import numpy as np >> arr1 = np.array(['a','b','c']) >> arr2 = np.array(['d','e','f']) >> >> I would like to produce a third array that would contain >> ['ad','be','cf']. Is there an efficient way to do this? I could do >> this element by element, but I need a faster method, as I need to do >> t

Re: [Numpy-discussion] Concatenating string arrays

2009-03-18 Thread Francesc Alted
A Wednesday 18 March 2009, Sturla Molden escrigué: > On 3/18/2009 7:30 PM, Thomas Robitaille wrote: > > import numpy as np > > arr1 = np.array(['a','b','c']) > > arr2 = np.array(['d','e','f']) > > > > I would like to produce a third array that would contain > > ['ad','be','cf']. Is there an efficie

Re: [Numpy-discussion] Concatenating string arrays

2009-03-18 Thread Sturla Molden
On 3/18/2009 7:30 PM, Thomas Robitaille wrote: > import numpy as np > arr1 = np.array(['a','b','c']) > arr2 = np.array(['d','e','f']) > > I would like to produce a third array that would contain > ['ad','be','cf']. Is there an efficient way to do this? I could do > this element by element, bu

[Numpy-discussion] Concatenating string arrays

2009-03-18 Thread Thomas Robitaille
Hello, I am trying to find an efficient way to concatenate the elements of two same-length numpy str arrays. For example if I define the following arrays: import numpy as np arr1 = np.array(['a','b','c']) arr2 = np.array(['d','e','f']) I would like to produce a third array that would contain