Home > Mobile >  Representing array elements on a square in Python (as image)
Representing array elements on a square in Python (as image)

Time:06-29

I have an array A with shape (3,3). Is there a way to represent the array elements on a square of size 3x3? In general, I would like to represent nxn arrays on a square of size nxn? The expected output is attached.

import numpy as np

A=np.array([[10,20,30],[40,50,60],[70,80,90]])

The expected output is:

Output

CodePudding user response:

You could use enter image description here

  • Related