I am reading from a file information of this style line by line
[[[106.23706131 74.19983673 53.1510033 ]]]
[[[59.24701176 41.45938749 29.7537066 ]]]
I want to pass this to other variables, but they are read in string format and I need them to be numpy arrays. Because when I use them I get the following error:
numpy.core._exceptions.UFuncTypeError: Cannot cast ufunc 'subtract' output from dtype('<U45') to dtype('float32') with casting rule 'same_kind'
How can I do it?
Quotes were added to be able to emulate a string, although I don't see them in your code, but you say they are in that format.
Without libraries, you might get the result like this, as a list object:
Cheers