So, your error is that instead of simply adding your latitute to the list, you are iterating over each character of the latitude, as a string, and adding that character to a list.

result=[]
for value in response_i['objcontent'][0]['rowvalues']:
    lat = value[0]
    print(lat)
    result.append(float(lat))

print (result)

Besides that, using range(len(...))) is the way things have to be done in almost all modern languages, because they either don't implement a "for ...each" or do it in an incomplete or faulty way.

In Python, since the beginning it is a given that whenever one wants a for iteration he wants to get the items of a sequence, not its indices (for posterior retrieval of the indices). Some auxiliar built-ins come in to play to ensure you just interate the sequence: zip to mix one or more sequences, and enumerate to yield the indices as well if you need them.

Answer from jsbueno on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-create-a-list-of-floats
Python - Create a List of Floats - GeeksforGeeks
July 23, 2025 - If you want to create a list of floats based on a mathematical operation, map() combined with lambda can be efficient.
🌐
Python Guides
pythonguides.com › create-list-in-python
Python List of Floats
February 2, 2026 - In my ten years of coding, I’ve noticed that map() is sometimes slightly faster than list comprehension for very basic conversions, though the difference is usually negligible for small apps. One thing I learned early on is that Python’s built-in range() function doesn’t work with floats. If you try range(0.0, 1.0, 0.1), Python will throw an error. To get around this, I always use the NumPy library. It has a function called arange (and another called linspace) that handles decimals perfectly. import numpy as np # Creating a range of mortgage rates from 5.0% to 6.0% with 0.2% increments mortgage_rates = np.arange(5.0, 6.2, 0.2).tolist() print(mortgage_rates) # Output: [5.0, 5.2, 5.4, 5.6, 5.8, 6.0]
Discussions

python - Create a list of floats with only a specific decimal [0.0, 0.7, 1.0, 1.7, 2.0, 2.7, 3.0, 3.7, 4.0, 4.7, ...etc] - Stack Overflow
I am reading from an excel file and require the generation of a list to pull from where it has every integer in a range to the number read as well as a specific decimal between each integer. For in... More on stackoverflow.com
🌐 stackoverflow.com
Python 3: how to create list out of float numbers? - Stack Overflow
So, your error is that instead ... of the latitude, as a string, and adding that character to a list. result=[] for value in response_i['objcontent'][0]['rowvalues']: lat = value[0] print(lat) result.append(float(lat)) print (result) Besides that, using range(len(...))) is the way things have to be done in almost all modern languages, because they either don't implement a "for ...each" or do it in an incomplete or faulty way. In Python, since the ... More on stackoverflow.com
🌐 stackoverflow.com
Python creating a lists of lists of floats from a single list of strings - Stack Overflow
I'm new to python and I need to create a list of lists (a matrix) of float values from a list of strings. So if my input is: objectListData = ["1, 2, 3, 4", "5, 6, 7, 8", "9, 0, 0, 7", "5, 4, 3, 2... More on stackoverflow.com
🌐 stackoverflow.com
August 9, 2013
python - How do I convert all of the items in a list to floats? - Stack Overflow
0 Conver list of numbers to floating point in Python 3.4 ... American film aired on TV in 2005-2012, set in the Midwest or South, where a family survives a tornado and a woman discusses rebuilding her house ... In Israel, what are the 2 election frontrunners' stated objections to entering a coalition with Israeli-Arab parties? Creature ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Finxter
blog.finxter.com › home › learn python blog › 5 best ways to generate list of floats in python
5 Best Ways to Generate List of Floats in Python - Be on the Right Side of Change
February 24, 2024 - One of the most concise methods for generating floats is to use list comprehension alongside range() to create a list of integers and then map those to floats.
🌐
Esri Community
community.esri.com › t5 › python-questions › how-do-i-create-a-list-of-floats-in-python › td-p › 516938
How do I create a list of floats in Python? - Esri Community
December 11, 2021 - Going further back in your code, your code to initialize a list of floats is not doing what you think: ... The code as written is creating a list with a single item, the item being a string with a single character, 'f'. You can initialize a float array, but the syntax is different: >>> import array >>> approxTen = array.array('f') >>> approxTen array('f') >>> ‍‍‍‍‍ · Lists are more common in Python than arrays because of their flexibility with data types and syntactic sugar for working with them, like list comprehensions.
🌐
Codingem
codingem.com › home › range of floats in python: a step-by-step guide (3 ways to do it)
Range of Floats in Python: A Step-by-Step Guide (3 Ways to Do It)
November 1, 2022 - To create a range of floats in Python, use a list comprehension. For example: [(x/10) for x in range(0, 5)] returns [0.0, 0.1, 0.2, 0.3, 0.4]
🌐
Stack Overflow
stackoverflow.com › questions › 72966341 › create-a-list-of-floats-with-only-a-specific-decimal-0-0-0-7-1-0-1-7-2-0-2
python - Create a list of floats with only a specific decimal [0.0, 0.7, 1.0, 1.7, 2.0, 2.7, 3.0, 3.7, 4.0, 4.7, ...etc] - Stack Overflow
import math Units = 5.8 addition = float("0." + str(Units).split(".")[1]) intList = list(range(math.ceil(Units))) finalList = intList + [x+addition for x in intList] finalList.sort() print(finalList) ... Per funnydman and Nin17 ... the addition part could be dirty. You could change to something like the below. The assumption is that Units will always be a float (have a decimal) because we are splitting it at that decimal to find the number of decimals points.
🌐
Finxter
blog.finxter.com › how-to-convert-a-string-list-to-a-float-list-in-python
How to Convert a String List to a Float List in Python – Be on the Right Side of Change
April 8, 2021 - You can also use the eval() function in a list comprehension to convert a list of strings to a list of floats: a = ["1.0", "2.0", "-3.4"] floats = [eval(x) for x in a] print(floats) # [1.0, 2.0, -3.4] 💡 Python’s built-in eval(s) function parses the string argument s into a Python expression, runs it, and returns the result of the expression.
🌐
PYnative
pynative.com › home › python › python range of float numbers
Python range of float numbers
April 13, 2021 - Use Python's numpy arange() and linspace() functions to generate a range of float numbers. Use decimal numbers as start, stop, and step value
Find elsewhere
🌐
Stack Abuse
stackabuse.com › bytes › how-to-add-a-float-to-a-list-in-python
How to Add a Float to a List in Python
July 1, 2022 - >>> float_list = [1.0, 2.5, 3.9] >>> float_list.extend([11.2, 12.3, 13.4]) >>> float_list [1.0, 2.5, 3.9, 11.2, 12.3, 13.4] The extend() method is different from append() in that it takes an iterable of values, like a list, and adds them to the end of the target list.
Top answer
1 of 2
4

Here ya go:

[[int(y) for y in x.split(",")] for x in objectListData]

output:

[[1, 2, 3, 4], [5, 6, 7, 8], [9, 0, 0, 7], [5, 4, 3, 2], [2, 3, 3, 3], [2, 2, 3, 3]]

or, if you want floats:

[[float(y) for y in x.split(",")] for x in objectListData]

output:

[[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0], [9.0, 0.0, 0.0, 7.0], [5.0, 4.0, 3.0, 2.0], [2.0, 3.0, 3.0, 3.0], [2.0, 2.0, 3.0, 3.0]]
2 of 2
2

The problem is that your inner lists are references to one single list and not individual lists.

>>> objectListDataFloats = [[0] * len(objectListData[0].split(', '))] * len(objectListData)

>>> objectListDataFloats
[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
>>> id(objectListDataFloats[0]) == id(objectListDataFloats[1])
True

After you fix that, you need to iterate from the starting index of 0, since the lists in Python start their index from 0.

for count in range(len(objectListData)):
    for ii in range(len(objectListData[count].split(', '))):
        objectListDataFloats[count][ii] = float(objectListData[count].split(', ')[ii])


>>> objectListDataFloats
[[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0], [9.0, 0.0, 0.0, 7.0], [5.0, 4.0, 3.0, 2.0], [2.0, 3.0, 3.0, 3.0], [2.0, 2.0, 3.0, 3.0]]

To completely do away with the initial initialization of the list with zeroes, you could also just build the list as you go along, something like

>>> objectListDataFloats = []
>>> for elem in objectListData:
        test_list = []
        for val in elem.split(','):
            test_list.append(float(val))
        objectListDataFloats.append(test_list)


>>> objectListDataFloats
[[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0], [9.0, 0.0, 0.0, 7.0], [5.0, 4.0, 3.0, 2.0], [2.0, 3.0, 3.0, 3.0], [2.0, 2.0, 3.0, 3.0]]

You don't need to iterate over the list or a string by using indices, you can just iterate over the list like in the above example.

Reduced Solution -

You could just reduce the whole solution to the following though (Change int to float if you require floating point numbers)

>>> objectListData = ["1, 2, 3, 4", "5, 6, 7, 8", "9, 0, 0, 7", "5, 4, 3, 2", "2, 3, 3, 3", "2, 2, 3, 3"]
>>> [map(int, elem.split(',')) for elem in objectListData]
[[1, 2, 3, 4], [5, 6, 7, 8], [9, 0, 0, 7], [5, 4, 3, 2], [2, 3, 3, 3], [2, 2, 3, 3]]
🌐
DaniWeb
daniweb.com › programming › software-development › threads › 422716 › how-to-make-single-float-into-list-of-float
python - How to make single float into list of float? | DaniWeb
May 8, 2012 - At the top of your program, you add thelist = list(). Then when you want to add a score to the list, you write thelist.append(score). Finally, add print(thelist) at the end. ... # numeric input function with range check # works with Python25+ ...
🌐
TechBeamers
techbeamers.com › python-float-range
Generate Floating Point Range in Python - TechBeamers
November 30, 2025 - However, all arguments are of integer type. If you pass a float, it results in a TypeError. start = 1 stop = 6.7 step = 0.1 for value in range(start, stop, step): print (value) When you run the above code, it throws the following error: TypeError: 'float' object cannot be interpreted as an integer · The above example suggests that Python doesn’t give any built-in way to generate a floating point range.
🌐
Finxter
blog.finxter.com › home › learn python blog › how to convert an integer list to a float list in python
How to Convert an Integer List to a Float List in Python - Be on the Right Side of Change
August 22, 2022 - The most Pythonic way to convert a list of integers ints to a list of floats is to use the list comprehension expression floats = [float(x) for x in ints]. It iterates over all elements in the list ints using list comprehension and converts each list element x to a float value using the float(x) ...
🌐
ItSolutionstuff
itsolutionstuff.com › post › python-generate-list-of-random-float-numbers-exampleexample.html
Python Generate List of Random Float Numbers Example - ItSolutionstuff.com
October 30, 2023 - import random import numpy as np low = 0.2 high = 2.9 # Python Generate List of Random Float Numbers Example floatList = [random.uniform(low, high) for _ in range(5)] print(floatList) ... [1.2810449626587266, 1.5206898226328796, 1.9837497458591744, 0.8076086725933713, 0.6949857530454222] ... import random import numpy as np low = 0.2 high = 2.9 # Python Generate List of Random Float Numbers Example floatList = [round(random.uniform(low, high), 2) for _ in range(5)] print(floatList)
🌐
Moonbooks
en.moonbooks.org › Articles › How-to-create-a-list-of-numbers-in-python-
How to Create a List of Numbers in Python - Moonbooks
March 9, 2018 - This is useful when you want a simple float list without installing any external library. If you use NumPy, you can create numbers with decimal steps using np.arange(). ... Use tolist() if you want to convert the NumPy array into a regular Python list. If you want a fixed number of evenly spaced values between two numbers, use np.linspace().
🌐
w3resource
w3resource.com › python-exercises › basic › python-basic-1-exercise-140.php
Python: Convert all items in a given list to float values - w3resource
May 24, 2025 - A list comprehension is used to create a new list, 'nums_of_floats', containing float representations of the decimal numbers. The final list of float numbers (nums_of_floats) is displayed.
🌐
GeeksforGeeks
geeksforgeeks.org › convert-string-float-to-float-list-in-python
Convert String Float to Float List in Python | GeeksforGeeks
February 6, 2025 - The task of converting a list of float strings to float values in Python involves changing the elements of the list, which are originally represented as strings, into their corresponding float data type.
🌐
GeeksforGeeks
geeksforgeeks.org › python › convert-string-float-to-float-list-in-python
Convert String Float to Float List in Python - GeeksforGeeks
July 12, 2025 - By using split() on a string containing float numbers, we can break it into individual string elements and then apply map() to convert each element into a float. This produces a list of floats derived from the original string.