You can either use:

[x / 10.0 for x in range(5, 50, 15)]

or use lambda / map:

map(lambda x: x/10.0, range(5, 50, 15))
Answer from Grzegorz Rożniecki on Stack Overflow
🌐
PYnative
pynative.com › home › python › python range of float numbers
Python range of float numbers
April 13, 2021 - For example, np.arange(0.5, 6.5, 1.5) will return the sequence of floating-point numbers starting from 0.5 up to 6.5. ... import numpy as np # range for floats with np.arange() for i in np.arange(0, 4.5, 0.5): print(i, end=', ') # Output 0.0, ...
🌐
Note.nkmk.me
note.nkmk.me › home › python
Maximum and Minimum float Values in Python | note.nkmk.me
August 11, 2023 - In Python, the float type is a 64-bit double-precision floating-point number, equivalent to double in languages like C. This article explains how to get and check the range (maximum and minimum values ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-range-for-float-numbers
Python - range() for Float Numbers - GeeksforGeeks
July 23, 2025 - We created a function float_range() that yields values from start to stop with a step size of 0.5.
🌐
LabEx
labex.io › questions › what-is-float64-384834
What is `float64`? | LabEx
November 2, 2025 - This means it can represent very large or very small numbers, as well as decimal values. Range: The range of values that can be represented by float64 is approximately ±1.8 × 10^308, with a precision of about 15 to 17 decimal digits.
🌐
Pythoninformer
pythoninformer.com › python-libraries › numpy › data-types
PythonInformer - Data types
September 14, 2019 - float64 numbers store floating point numbers in the same way as a Python float value. They are sometimes called double precision. float32 numbers take half as much storage as float64, but they have considerably smaller range and .
🌐
NumPy
numpy.org › doc › stable › user › basics.types.html
Data types — NumPy v2.4 Manual
If 64-bit integers are still too small the result may be cast to a floating point number. Floating point numbers offer a larger, but inexact, range of possible values. >>> np.power(100, 100, dtype=np.int64) # Incorrect even with 64-bit int 0 >>> np.power(100, 100, dtype=np.float64) 1e+200
Find elsewhere
🌐
Python⇒Speed
pythonspeed.com › articles › float64-float32-precision
The problem with float32: you only get 16 million values
February 1, 2023 - So how do you fit float64s into float32s without losing precision? By transforming the data so it has a range of at most 16 million (centered around zero!) for a given level of precision.
🌐
Delft Stack
delftstack.com › home › howto › python › python range float
How to Get Range of Floating Numbers in Python | Delft Stack
February 2, 2024 - This tutorial demonstrates how to use the range() function to get a sequence of float values in Python
🌐
GitHub
github.com › numpy › numpy › issues › 12149
python 2.7 range accepts numpy float16, float32, complex when it should raise TypeError · Issue #12149 · numpy/numpy
October 11, 2018 - In python 2.7, range accepts numpy.float16 and np.float32, np.float128, complex64 and complex128 as inputs, which it really shouldn't. Reproducing code example: >>> import numpy as np >>> range(np.float16(4)) [0, 1, 2, 3] >>> range(np.fl...
Author   hmaarrfk
🌐
w3resource
w3resource.com › numpy › data-types.php
NumPy: Data types - w3resource
NumPy Data types: NumPy supports a much greater variety of numerical types than Python does. This section shows which are available, and how to modify an array’s data-type.
🌐
SciPy
docs.scipy.org › doc › numpy-1.13.0 › user › basics.types.html
Data types — NumPy v1.13 Manual
March 12, 2019 - Python’s floating-point numbers are usually 64-bit floating-point numbers, nearly equivalent to np.float64. In some unusual situations it may be useful to use floating-point numbers with more precision.
🌐
TechBeamers
techbeamers.com › python-float-range
Generate Floating Point Range in Python - TechBeamers
November 30, 2025 - Do you wish to learn how to generate a float range of numbers in Python? In this tutorial, you will find many ways to produce floating point values within a given range. We’ve provided several Python…
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › python range() with float values
Python range() with float values - Spark By {Examples}
May 31, 2024 - Let's see how to return the range of float values in Python by using the numpy.arange() and numpy.linspace() methods. Python range() will not be
🌐
NumPy
numpy.org › devdocs › user › basics.types.html
Data types — NumPy v2.5.dev0 Manual
If 64-bit integers are still too small the result may be cast to a floating point number. Floating point numbers offer a larger, but inexact, range of possible values. >>> np.power(100, 100, dtype=np.int64) # Incorrect even with 64-bit int 0 >>> np.power(100, 100, dtype=np.float64) 1e+200
🌐
Medium
medium.com › @amit25173 › understanding-numpy-float64-a300ac9e096a
Understanding numpy.float64. If you think you need to spend $2,000… | by Amit Yadav | Medium
February 8, 2025 - Higher Precision: Python’s default float uses 64-bit precision, but NumPy’s float64 specifically guarantees that your floating-point numbers have the highest possible precision for calculations.
🌐
Python.org
discuss.python.org › ideas
Float contained in range - Ideas - Discussions on Python.org
September 7, 2023 - I have found that checking if a float number falls inside a range() doesn’t work, always giving False: >>> 1.0 in range (0, 2) True >>> 1.5 in range (0, 2) False I can understand that range() can only accept integer va…