我想知道是否可以分别获取 ndarray 的 x 和 y 维度。我知道我可以使用ndarray.shape获取表示维度的元组,但如何在 x 和 y 信息中分离它?
ndarray.shape
先感谢您。
您可以使用元组拆包。
y, x = a.shape