[SciPy-User] [SciPy-user] How to get access to Array elements

suzana8447 k-assem84 at hotmail.com
Fri May 13 08:34:11 EDT 2011


thanks very much

peteT wrote:
> 
> Hi,
> 
> At=array([2,3,8,10])
> x=At[2] #remember that indexing begins with 0.
> if x==8:
>     print x
> 
> hth
> 
> Peter
> On May 6, 2011 6:42 AM, "suzana8447" <k-assem84 at hotmail.com> wrote:
>>
>> Hello for all,
>>
>> I am still a beginner in the Python language.
>> I have a problem and hope that some can help me.
>> I my program I have an array called for example densities=
>> array([1,2,8,10,50)]
>> note that the third element in the array is 8. I want to form an if
>> statement as this:
>> if(x==8): print x # just as an example.
>> But how to declare x as the third elemnt of the above array.
>> Thanks in advance.
>>
>> --
>> View this message in context:
> http://old.nabble.com/How-to-get-access-to-Array-elements-tp31551042p31551042.html
>> Sent from the Scipy-User mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
> 
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-get-access-to-Array-elements-tp31551042p31610991.html
Sent from the Scipy-User mailing list archive at Nabble.com.




More information about the SciPy-User mailing list