I haven't found a solution so far and I tried so many things. Hope some of you guys can help me. I am using Python.
I have a .txt file with values like: 9,5,7,6,4
And I want to read this file as an array with float values, so it should look like:
array([9.0, 5.0, 7.0, 6.0, 4.0], dtype=float32)
The only thing I found so far is looks like:
array(['9,5,7,6,4),dtype='<U9'])
and is a string and not a float.
Thanks for helping!
open(),read(); split in withsplit(",")and you get list["9", "5" , "7", "6", "4"]- and usefor-loop withfloat()to convert every element on list to float value.