Re: [Tutor] passing global variable as argument.

2012-07-16 Thread Bala subramanian
Thank you wayne and steven. You suggestion to create a fresh array within the function and assigning it to variable worked fine and the result was exactly what i was looking for. In future i remember not to use global variables as fn. parameters. thanks once again for detailed explanation, bala O

Re: [Tutor] passing global variable as argument.

2012-07-16 Thread Steven D'Aprano
Bala subramanian wrote: Friends, I want to define a function that can populate an array by taking its name (which is defined globally). I defined two empty arrays as follows and a function that can populate the array. In general it is tricky to resize and populate numpy arrays in place. It is

Re: [Tutor] passing global variable as argument.

2012-07-16 Thread Wayne Werner
On Mon, 16 Jul 2012, Bala subramanian wrote: Friends, I want to define a function that can populate an array by taking its name (which is defined globally). Are you sure this is what you really want to do? I've noticed that many times that I want to do something, but only because I don't under

Re: [Tutor] passing global variable as argument.

2012-07-16 Thread Dave Angel
On 07/16/2012 07:00 AM, Bala subramanian wrote: > Friends, > I want to define a function that can populate an array by taking its name > (which is defined globally). I defined two empty arrays as follows and a > function that can populate the array. > > REF_F1=np.array([]) > REF_F2=np.array([]) > >