Converting an array of string to array of float

Nitin Pawar nitinpawar432 at gmail.com
Fri Mar 25 11:25:13 EDT 2011


did you try type casting with float ?

On Fri, Mar 25, 2011 at 8:49 PM, joy99 <subhakolkata1234 at gmail.com> wrote:

> Dear Group,
>
> I got a question which might be possible but I am not getting how to
> do it.
>
> If I have a list, named,
> list1=[1.0,2.3,4.4,5.5....]
>
> Now each element in the array holds the string property if I want to
> convert them to float, how would I do it?
>
> Extracting the values with for and appending to a blank list it would
> not solve the problem. If appended to a blank list, it would not
> change the property.
>
> If any one of the learned members can kindly suggest any solution?
>
> Thanks in advance.
> Best Regards,
> Subhabrata.
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Nitin Pawar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110325/3d8590af/attachment.html>


More information about the Python-list mailing list