I am having an issue of creating an array of floats. I have a loop that is scanning the rows of an attribute table and extracting numbers from it. SARAarea, truearea and rasterarea are all extracted from an attribute table and they should be floats. I am trying to use these numbers and do calculations with them and then insert them back into the attribute table. My main issue is adding floats to the list. I keep getting error messages that a float is not iterable or a float is not an attribute to append or extend. What is the best way to do this? I tried to create one loop that would getvalue and insert value into the attribute without using a list. But the searchcursor function only allows me to create two separate loops because there is a seachCursor and a UpdateCursor, it only allows me to do one task at a time.
This is my attempt at initializing the lists
approxTen<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="string token">'f'</SPAN><SPAN class="punctuation token">]</SPAN>
approxremaining<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="string token">'f'</SPAN><SPAN class="punctuation token">]</SPAN>
lessperc<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="string token">'f'</SPAN><SPAN class="punctuation token">]</SPAN>
moreperc<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="string token">'f'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
This is where I am getting my errors. The code is in a while loop of a searchCursor. "While row:".
approxTen<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">(</SPAN>SARAarea<SPAN class="operator token">*</SPAN>truearea<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">/</SPAN>rasterarea
approxremaining<SPAN class="operator token">=</SPAN>truearea<SPAN class="operator token">-</SPAN>approxTen
lessperc<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">(</SPAN>approxTen<SPAN class="operator token">/</SPAN>truearea<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">*</SPAN><SPAN class="number token">100</SPAN>
moreperc<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">(</SPAN>approxremaining<SPAN class="operator token">/</SPAN>truearea<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">*</SPAN><SPAN class="number token">100</SPAN>
approxTen<SPAN class="punctuation token">.</SPAN>append<SPAN class="punctuation token">(</SPAN>approxTen<SPAN class="punctuation token">)</SPAN>
approxremaining<SPAN class="punctuation token">.</SPAN>append<SPAN class="punctuation token">(</SPAN>approxremaining<SPAN class="punctuation token">)</SPAN>
lessperc<SPAN class="punctuation token">.</SPAN>append<SPAN class="punctuation token">(</SPAN>lessperc<SPAN class="punctuation token">)</SPAN>
moreperc<SPAN class="punctuation token">.</SPAN>append<SPAN class="punctuation token">(</SPAN>moreperc<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Common error I am getting below. Line 50 is line 7 in the code above. I have tried extend and append but neither worked and I haved tried putting float() around the values of approxTen and the rest of them but it did not work.
For example: approxremaining= float(truearea-approxTen)

This is how I am inserting it back into the attribute table. Below is a separate loop then above code. I am trying to loop through the list and add it to the attribute table.
<SPAN class="keyword token">while</SPAN> row3<SPAN class="punctuation token">:</SPAN>
row3<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="operator token">=</SPAN>approxTen<SPAN class="punctuation token">[</SPAN>row3<SPAN class="punctuation token">]</SPAN>
row3<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="operator token">=</SPAN>approxremaining<SPAN class="punctuation token">[</SPAN>row3<SPAN class="punctuation token">]</SPAN>
row3<SPAN class="punctuation token">[</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="operator token">=</SPAN>lessperc<SPAN class="punctuation token">[</SPAN>row3<SPAN class="punctuation token">]</SPAN>
row3<SPAN class="punctuation token">[</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="operator token">=</SPAN>moreperc<SPAN class="punctuation token">[</SPAN>row3<SPAN class="punctuation token">]</SPAN>
cursoru<SPAN class="punctuation token">.</SPAN>updateRow<SPAN class="punctuation token">(</SPAN>row3<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>