Answers for "how to drop an axis in numpy"

C
10

python drop axis

df.drop(['colonna da togliere'], axis=1)
Posted by: Guest on April-06-2020
0

remove axis numpy array

x = np.array([[[0], [1], [2]]])
x.shape
(1, 3, 1)
np.squeeze(x).shape
(3,)
np.squeeze(x, axis=0).shape
(3, 1)
np.squeeze(x, axis=1).shape
Posted by: Guest on March-15-2021

Code answers related to "C"

Browse Popular Code Answers by Language