Print an integer array as hexadecimal numbers

后端 未结 7 484
南方客
南方客 2020-12-11 00:43

I have an array created by using

array1 = np.array([[25,  160,   154, 233],
                   [61, 244,  198,  248],
                   [227, 226, 141, 72 ]         


        
相关标签:
7条回答
  • 2020-12-11 01:33

    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.)

    0 讨论(0)
提交回复
热议问题