Brilliant! Thanks.<br><br><div class="gmail_quote">On Thu, Jun 19, 2008 at 10:00 AM, Cédric Lucantis <<a href="mailto:omer@no-log.org">omer@no-log.org</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Le Thursday 19 June 2008 17:12:08 Jonno, vous avez écrit :<br>
<div class="Ih2E3d">> Hi,<br>
><br>
> I'm very new to programming and python.<br>
><br>
> I need to convert a string like this:<br>
> '               0.906366     2.276152       0.013369    80.773141<br>
> 0.002836  -107.335197       0.011462    86.846290    \n'<br>
> to an array of floats.<br>
><br>
<br>
</div>string = '0.906366     2.276152       0.013369    80.773141'<br>
array = [float(s) for s in string.split()]<br>
<br>
--<br>
Cédric Lucantis<br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a></font></blockquote></div><br><br clear="all"><br>-- <br>"If a theory can't produce hypotheses, can't be tested, can't be disproven, and can't make predictions, then it's not a theory and certainly not science." by spisska on Slashdot, Monday April 21, 2008