ValueError: could not convert string to float: Error like 'One'
The storage code is test_4d_array.to_netcdf('test (2010-2022).nc').
python
I'll show you a reproduction of the error message.
>>> float("1")
1.0
>>> float("2.33")
2.33
>>> s = 1
>>> float(s)
1.0
>>> s = 3.3
>>> float(s)
3.3
>>> s = "One"
>>> float(s)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: could not convert string to float: 'One'
>>>
© 2024 OneMinuteCode. All rights reserved.