I have a numpy array where each element looks something like this:
[\'3\' \'1\' \'35\' \'0\' \'0\' \'8.05\' \'2\'] [\'3\' \'1\' \'\' \'0\' \'0\' \'8.4583\' \
If your array is t:
t[t=='']='0'
and then convert it.
Explanation:
t=='' creates a boolean array with the same shape as t that has a True value where the corresponding t value is an empty space. This boolean array is then used to assign '0' only to the appropriate indices in the original t.
t==''
t
'0'