Re: [Numpy-discussion] replace array values efficiently

2009-01-08 Thread Robert Kern
On Fri, Jan 9, 2009 at 01:19, Prashant Saxena wrote: > Hi, > > I am new to numpy and getting my hands on slowly. > > How do you replace integers from strings in an integer array. (1D) > > For example: > > array = {1,1,1,2,3,3,4} > > replace 1 with "apple" > replace 2 with "cheery" > replace 3 with

[Numpy-discussion] replace array values efficiently

2009-01-08 Thread Prashant Saxena
Hi, I am new to numpy and getting my hands on slowly. How do you replace integers from strings in an integer array. (1D) For example: array = {1,1,1,2,3,3,4} replace 1 with "apple" replace 2 with "cheery" replace 3 with "mango" replace 4 with "banana" I know the general solution, but I am lo