I have a numpy array of strings. When a value in the array is undefined, None is printed as you would expect. Is it possible to provide a default value for None values?
e.g. in the following I want “_” instead of None
[[None B C]
[M None O]
[X Y None]]
would become
[[_ B C]
[M _ O]
[X Y _]]
a simple solution might be to transform your array to string first and then replace the string None afterwards, for example if your matrix is
a:you can also define a function: