New-Axis

Sat 17 May 2025

import numpy as np

x1 = np.arange(1,10).reshape(3,3)
print(x1.shape)

x1_new = x1[:,np.newaxis]
print(x1_new.shape)
(3, 3)
(3, 1, 3)


Score: 0

Category: array