<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 14, 2013 at 6:12 AM, Ana Dionísio <span dir="ltr"><<a href="mailto:anadionisio257@gmail.com" target="_blank">anadionisio257@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!!<br>
<br>
I keep having this error and I don't know why: TypeError: 'float' object is not iterable.<br>
<br>
I have this piece of code, that imports to python some data from Excel and saves it in a list:<br>
<br>
"<br>
t_amb = []<br>
<br>
for i in range(sh2.nrows):<br>
    t_amb.append(sh2.cell(i,2).value)<br>
<br>
print t_amb<br>
<br>
"<br>
Here is everything ok.<br>
<br>
But then, I need to pass the data again to exel, so I wrote this:<br>
<br>
"<br>
a=8<br>
for b in range (len(t_amb)):<br>
    a=8<br>
    for d in t_amb[b]:<br>
        a=a+1<br>
        sheet.write(a,b+1,d)<br>
"<br>
<br>
The error appear in "for d in t_amb[b]:" and I don't understand why. Can you help me?<br></blockquote><div><br></div><div>Most likely the value of t_amb[[b] is a float.  It would have to be a list or a tuple or some other sequence to be iterable.  I can't tell what you are trying to do here <br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><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><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div>Joel Goldstick<br></div><a href="http://joelgoldstick.com" target="_blank">http://joelgoldstick.com</a><br></div>
</div></div>