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
This is where I am getting my errors. The code is in a while loop of a searchCursor. "While row:".
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.