This Video is a part of a NumPy Tutorial Series: Start the entire series here:
• Introduction to NumPy Arrays for Begi...
We're continuing on in our NumPy series by talking about how to reshape and index numpy arrays.
We'll talk about reshaping using the reshape method and .T transposes
We'll also talk about how to select a row, column, and specific value from a numpy array using indexing.
Thanks for all the support! Almost to 5k subscribers. Insanely awesome. Thank you for all the kind words!
Join The Socials -- Picking Shoutouts Across YouTube, Insta, FB, and Twitter!
FB - / codewithderrick
Insta - / codewithderrick
Twitter - / codewithderrick
LinkedIn - / derricksherrill
GitHub - https://github.com/Derrick-Sherrill
*****************************************************************
Full code from the video:
import numpy as np
#Create simple array
array_a = np.array([[1,2,3],[4,5,6]])
print(array_a.shape)
New Attribute Array Size
print(array_a.size)
Number of Rows times Number of Columns
Reshape Array
array_b = array_a.reshape(3,2)
print(array_b)
print(array_b.shape)
#transpose array_a
array_c = array_a.T
print(array_c)
print(array_c.shape)
Access Row
print(array_c[0])
Access Columns
print(array_c[:,0])
Access Specific Values
print(array_c[1,1])
https://github.com/Derrick-Sherrill/N...
Packages (& Versions) used in this video:
Python 3.7
NumPy 1.17
*****************************************************************
Code from this tutorial and all my others can be found on my GitHub:
https://github.com/Derrick-Sherrill/D...
Check out my website:
https://www.derricksherrill.com/
If you liked the video - please hit the like button. It means more than you know. Thanks for watching and thank you for all your support!!
Always looking for suggestions on what video to make next -- leave me a comment with your project! Happy Coding!