[Numpy-discussion] Dealing with arrays

DIPO ELEGBEDE dipo.elegbede at gmail.com
Tue Sep 20 12:17:13 EDT 2011


I think that should sort it.

def p(option_lists):
    for option_list in option_lists:
        array = numpy.array(option_list)
        for i in array: print i

the option_lists here is the list of lists
looping through it and then converting it into a numpy array is quiet easy.

If I try to loop through the array as you adviced, it prints out the whole
items in the array.

You could also try that out.

What I am trying to achieve however is to loop through the 12 arrays and get
them one after the other, doing something like:

for my_array in list_of_arrays:
  print my_array[0]


Hope this is clear enough.
Thanks for your patience.


On 20 September 2011 17:11, Olivier Delalleau <shish at keba.be> wrote:

> Can you please provide your current code, even if incomplete / not working?
> It's hard to tell what's wrong without looking at the code.
>
> -=- Olivier
>
> 2011/9/20 <dipo.elegbede at gmail.com>
>
>> Olivier, the code you sent did so much magic and I'm definitely using
>> that.
>>
>> What baffles me is that looping through the 12 arrays seem impossible.
>> I have tried what you just sent but it won't just work.
>> You could confirm this.
>> Sent from my BlackBerry wireless device from MTN
>>
>> -----Original Message-----
>> From: Olivier Delalleau <shish at keba.be>
>> Sender: numpy-discussion-bounces at scipy.org
>> Date: Tue, 20 Sep 2011 12:00:51
>> To: Discussion of Numerical Python<numpy-discussion at scipy.org>
>> Reply-To: Discussion of Numerical Python <numpy-discussion at scipy.org>
>> Subject: Re: [Numpy-discussion] Dealing with arrays
>>
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion at scipy.org
>> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
>>
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion at scipy.org
>> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>


-- 
Dipo Elegbede,OCA
08033299270,08077682428
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110920/5b67066c/attachment.html>


More information about the NumPy-Discussion mailing list