close

 

In Python, if we want to multiple 2 list elements into 1 list, we have to use +. But, if we use + in numpy, it will give us the sum of the list.

 

It’s quite simple to stack in Numpy. There are two functions for us to stack list, np.hstack() and np.vstack(). Be sure to remember vertical and horizontal, np.vstack() operate axis 0 and np.hstack() operate axis 1. No need to learn 3 dimensions in case you’ll mess up all of this.

Screenshot 2021-05-02 132356.jpg

Screenshot 2021-05-02 132456.jpg

創作者介紹
創作者 Wayneezzzz 的頭像
Wayneezzzz

Wayneezzzz

Wayneezzzz 發表在 痞客邦 留言(0) 人氣()