Try using np.vectorize:
printer = np.vectorize(lambda x:'{0:5}'.format(x,))
print printer(b).astype(object)
Or try using np.set_printoptions:
Exactly as shown in IDLE:
>>>x=np>>> import numpy as np
>>> x=np.random.random(10)
>>>print(>>> x)
array([ 0.0797939772239823, 0.0707837769938461, 0.5195370585466846, 0.2694969703294278, 0.9511419706698482,
0.41241448
04137562, 0.325879384223521 , 0.9128238581317235, 0.0172536762221494, 0.34671691]6205595 ])
>>>np>>> np.set_printoptions(precision=3)
>>>print>>> print(x)
[ 0.08 722 0.071699 0.52 855 0.269033 0.951067 0.412041 0.326422 0.913813 0.017622 0.347]621]