printing a two dimensional array in python

后端 未结 7 1877
执念已碎
执念已碎 2020-12-01 02:39

I have to print this python code in a 5x5 array the array should look like this :

0 1 4 (infinity) 3
1 0 2 (infinity) 4
4 2 0  1         5
(inf)(inf) 1 0            


        
7条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 03:31

    There is always the easy way.

    import numpy as np
    print(np.matrix(A))
    

提交回复
热议问题