Python Numpy Tutorial Split Array

Опубликовано: 13 Август 2019
на канале: Python Marathon
1,796
15

Descargar el Código: patreon.com/pythonmaraton

Join Patreon: patreon.com/pythonmaraton
^Downloadable code & more! np.split()

python import numpy as np

create random matrix A. split takes in an array, the number of splits and the axis to split on.

a split 3 defaults to axis = 0 so it splits on the rows that is the same as vsplit

np.split(A,3,axis=3) splits down the columns so it acts the same as np.hspliit

Let’s look at A again. So depending on the axis you can split it this way or this way.

Lets look at the documentation . Again we have our three partakers: ann array, the mount of pieces to split it in, and the axis to split on.

As a reminder, the number of splits needs to be a divisor of the axis shape. And axis 0 refers to the rows and axis 1 refers the columns .

There you have it, that is how you can use np.split to split arrays in python.

Please check out some of my other python videos and please consider subscribing for more python programming content.

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 Marathon playlist by Rylan Fowers.

✅Subscribe: https://www.youtube.com/channel/UCub4...

📺Channel: https://www.youtube.com/channel/UCub4...

▶️Watch Latest Python Content: https://www.youtube.com/watch?v=myCPg...

▶️Watch Latest Other Content: https://www.youtube.com/watch?v=2YfQs...



🎵Theme Music: www.bensound.com

🔊Sound Effects: www.zapsplat.com



#PythonMarathon #LearnPython #PythonTutorial


На этой странице сайта вы можете посмотреть видео онлайн Python Numpy Tutorial Split Array длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Python Marathon 13 Август 2019, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 1,796 раз и оно понравилось 15 зрителям. Приятного просмотра!