This video is apart of a Learn NumPy Series, Watch the whole playlist here:
• Introduction to NumPy Arrays for Begi...
We'll continue the series with a brief video talking about NumPy Data Types and their memory allocations.
#python #numpy #tutorial
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
Thanks so much for all the continued support!! 4930+ subscribers at the time of writing. That's so awesome for some guy just making educational python videos. Thanks so much for all the support! You guys rock. Thanks for all the encouragement to keep going.
*****************************************************************
Full code from the video:
import numpy as np
Available Data types
np.int16 Integer (-32768 to 32767)
np.int32 Integer (-2147483648 to 2147483647)
np.int64 Integer (-9223372036854775808 to 9223372036854775807)
array_a = np.array([32766, 32767, 32768])
Checking dtype
print(array_a.dtype)
array_b = np.array([32766, 32767, 32768], dtype=np.int16)
print(array_b)
#Overflow of NumPy Data Type (Unexpected Results)
Argument for using smaller data types outside scope of course
np.uint16 Unsigned integer (0 to 65535)
np.uint32 Unsigned integer (0 to 4294967295)
np.uint64 Unsigned integer (0 to 18446744073709551615)
array_c = np.array([-1,0,1], dtype=np.uint64)
print(array_c)
np.float64 matches python float
Other NumPy Data Types:
np.bool_ (True/False)
np.complex_ (Complex Numbers)
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!