NumPy Default Arrays (Zeros, Ones, Full methods) - Learn NumPy Series

Опубликовано: 12 Октябрь 2024
на канале: Derrick Sherrill
5,200
146

This video is a part of a full series - start here:
   • Introduction to NumPy Arrays for Begi...  

In this one we'll cover how to create arrays using the zeros, ones, and full numpy methods.



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

array_a = np.array([[1,2,3],[4,5,6]], dtype=float)
print(array_a)

array_b = np.zeros((3,3))
print(array_b)

array_c = np.ones((3,3))
print(array_c)

array_d = np.full((3,3), 5)
print(array_d)

array_e = np.random.random((3,4))
print(array_e)

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!