I receive strings as follows that I need to save and then convert back to numpy arrays later
[0.46619281 -0.79148525 0.20800316 -0.16633733 1.53767002]
[ 0.53119281 -0.79148525 0.20800316 -0.16633733 1.53762345 ]
Note how the second line has a space after the first [ and before the last ]
How can I format the string to change it so that it does not have this space before and after the brackets?
I need a consistent way to store the arrays as strings so I can then convert them back again as detailed in this post: Convert string containg array of floats to numpy array