Reshape -1, 1 and Reshape 1, -1 in Python NumPy | Module NumPy Tutorial - Part 07

Опубликовано: 29 October 2024
на канале: Koolac
2,500
92

In this video we will talk about Reshape -1,1 and Reshape 1, -1 in Python Numpy module and their meaning with examples.

==================================
NumPy Module Tutorial Playlist for Machine Learning:
==================================
   • Numpy Python Playlist  

==================================
Source Code:
==================================
import numpy as np
x=np.array([
[1,2,0],
[3,4,0]
])

y1=x.reshape(-1,1) # col-wise vector
print(y1)

y2=x.reshape(1,-1) # row-wise vector
print(y2)