def str_to_array(s):
 import numpy as np
 from numpy import inf, nan
 if s.startswith(u'array'):
  s = s[6:(-1)]
 if s.startswith(u'['):
  a = np.array(eval(s), dtype=float)
 else:
  a = np.atleast_1d(float(s))
 return a

def str_to_array ( s ) : import numpy as np from numpy import inf , nan if s . startswith ( u'array' ) : s = s [ 6 : ( - 1 ) ] if s . startswith ( u'[' ) : a = np . array ( eval ( s ) , dtype = float ) else : a = np . atleast_1d ( float ( s ) ) return a
simplistic converter of strings from repr to float numpy arrays .