I have an array created by using
array1 = np.array([[25, 160, 154, 233],
[61, 244, 198, 248],
[227, 226, 141, 72 ]
It should be possible to get the behavior you want with numpy.set_printoptions, using the formatter
keyword arg. It takes a dictionary with a type specification (i.e. 'int'
) as key and a callable object returning the string to print. I'd insert code but my old version of numpy
doesn't have the functionality yet. (ugh.)