Python Tutorial - Numpy Hstack

preview_player
Показать описание


This is a Python anaconda tutorial for help with coding, programming, or computer science. These are short python videos dedicated to troubleshooting python problems and learning Python syntax. For more videos see Python Help playlist by Rylan Fowers.





we import numpy as np

And now we will create some arrays to demonstrate with.

We will press the up arrow on the keyboard to bring that up again, and we can edit it to make a matrix y

So here we have matrix x

and here is matrix y

Notice the x array is on the left and the y matrix is on the right since we put x first then y. h stack is horizontal stack. For it to work, both matrices must have the same amount of ROWS

So remember HR Hstack works when Rows line up.

There you have it, that is how you use Hstack in python

#PythonMarathon #LearnPython #PythonTutorial
Рекомендации по теме
Комментарии
Автор

What is the use of vstack and hstack ? I mean can you give me any practical example depicting the use of vstack and hstack

milindrastogi