Python NumPy Tutorial for Beginners

  Рет қаралды 1,456,630

freeCodeCamp.org

freeCodeCamp.org

4 жыл бұрын

Learn the basics of the NumPy library in this tutorial for beginners. It provides background information on how NumPy works and how it compares to Python's Built-in lists. This video goes through how to write code with NumPy. It starts with the basics of creating arrays and then gets into more advanced stuff. The video covers creating arrays, indexing, math, statistics, reshaping, and more.
💻 Code: github.com/KeithGalli/NumPy
🎥 Tutorial from Keith Galli. Check out his KZfaq channel: / @keithgalli
⭐️ Course Contents ⭐️
⌨️ (01:15) What is NumPy
⌨️ (01:35) NumPy vs Lists (speed, functionality)
⌨️ (09:17) Applications of NumPy
⌨️ (11:08) The Basics (creating arrays, shape, size, data type)
⌨️ (16:08) Accessing/Changing Specific Elements, Rows, Columns, etc (slicing)
⌨️ (23:14) Initializing Different Arrays (1s, 0s, full, random, etc...)
⌨️ (31:34) Problem #1 (How do you initialize this array?)
⌨️ (33:42) Be careful when copying variables!
⌨️ (35:45) Basic Mathematics (arithmetic, trigonometry, etc.)
⌨️ (38:20) Linear Algebra
⌨️ (42:19) Statistics
⌨️ (43:57) Reorganizing Arrays (reshape, vstack, hstack)
⌨️ (47:29) Load data in from a file
⌨️ (50:20) Advanced Indexing and Boolean Masking
⌨️ (55:59) Problem #2 (How do you index these values?)
⭐️ Links with more info ⭐️
🔗 NumPy vs Lists: / channel
🔗 Indexing: docs.scipy.org/doc/numpy-1.13...
🔗 Array Creation Routines: docs.scipy.org/doc/numpy/refe...
🔗 Math Routines Docs: docs.scipy.org/doc/numpy/refe...
🔗 Linear Algebra Docs: docs.scipy.org/doc/numpy/refe...
--
Learn to code for free and get a developer job: www.freecodecamp.org
Read hundreds of articles on programming: www.freecodecamp.org/news

Пікірлер: 518
@cram2208
@cram2208 4 жыл бұрын
Seriously, side-by-side comparisons are the BEST !! As visual as it can get ! 🙏
@TheNotoriousFonzy
@TheNotoriousFonzy 2 жыл бұрын
Keith, I've taken a heavy interest in data science lately and your courses absolutely rock !!! Many thanks to you for teaching me these fundamentals in such an informative, easy-to-understand manner.
@George-te4ms
@George-te4ms 2 жыл бұрын
how is the progress?
@bluegtturbo
@bluegtturbo 4 жыл бұрын
You Sir are an amazing teacher!! There are many software gurus in the world, but sadly few who can impart their knowledge as you do...
@jozbornn
@jozbornn 3 жыл бұрын
This was a phenomenal overview of numpy. I feel confident that I can tackle more advanced topics now!
@arthurgomberg164
@arthurgomberg164 3 жыл бұрын
Well done. Quick ,short & straight to the point!
@smiley-wu1kn
@smiley-wu1kn Жыл бұрын
This is the first tutorial that I actually finished. Thank you, Keith!
@shritishaw7510
@shritishaw7510 2 жыл бұрын
finally, done with the entire video, tbh, it took me 6 hours to get myself acquainted with the working of the NumPy library and the Jupyter notebook. Thank you for this awesome tutorial
@cornelius600
@cornelius600 4 жыл бұрын
1.25 speed is perfect, thanks for the video
@cybermanithan7514
@cybermanithan7514 3 жыл бұрын
thanks for tips
@marcustulliuscicero9512
@marcustulliuscicero9512 2 жыл бұрын
I'm on 2.5
@ugos_bizarre_adventures_6866
@ugos_bizarre_adventures_6866 2 жыл бұрын
Thx bro
@JaFupy
@JaFupy Жыл бұрын
Yup
@toke7342
@toke7342 Жыл бұрын
2x speed is better. Saves alot of time.
@rajdeepchakraborty7961
@rajdeepchakraborty7961 3 жыл бұрын
One of the finest Numpy tutorials. Keep up the great work guys!
@gokul8747
@gokul8747 3 жыл бұрын
⭐️ Course Contents ⭐️ ⌨️ (01:15) What is NumPy ⌨️ (01:35) NumPy vs Lists (speed, functionality) ⌨️ (09:17) Applications of NumPy ⌨️ (11:08) The Basics (creating arrays, shape, size, data type) ⌨️ (16:08) Accessing/Changing Specific Elements, Rows, Columns, etc (slicing) ⌨️ (23:14) Initializing Different Arrays (1s, 0s, full, random, etc...) ⌨️ (31:34) Problem #1 (How do you initialize this array?) ⌨️ (33:42) Be careful when copying variables! ⌨️ (35:45) Basic Mathematics (arithmetic, trigonometry, etc.) ⌨️ (38:20) Linear Algebra ⌨️ (42:19) Statistics ⌨️ (43:57) Reorganizing Arrays (reshape, vstack, hstack) ⌨️ (47:29) Load data in from a file ⌨️ (50:20) Advanced Indexing and Boolean Masking ⌨️ (55:59) Problem #2 (How do you index these values?)
@yahyafati
@yahyafati 3 жыл бұрын
Why?
@baylee1791
@baylee1791 2 жыл бұрын
thanks bhai
@za012345678998765432
@za012345678998765432 2 жыл бұрын
+
@sanketemala1118
@sanketemala1118 Жыл бұрын
@@yahyafati u were dumb or something'
@alexroode2659
@alexroode2659 9 ай бұрын
@gokul8747 is the hero of this comment section
@dohkang3725
@dohkang3725 Жыл бұрын
Thank you for great video, Keith Galli. I had some problem of understanding Numpy before. Thanks to your help, I have strong basic knowledge of Numpy :)
@tonyhathuc
@tonyhathuc 3 жыл бұрын
This is absolutely great content! Thank you so much for doing this!
@SK-zl3qg
@SK-zl3qg 2 жыл бұрын
Absolute clarity and upto speed. Very comprehensive coverage.
@63khushalsolanki9
@63khushalsolanki9 2 жыл бұрын
Thats the most english I have heard all day
@shdnas6695
@shdnas6695 2 жыл бұрын
@@63khushalsolanki9 lol
@user-yt7vl3uh7g
@user-yt7vl3uh7g 6 ай бұрын
love the content ! i have just started to learn numpy for my course and this certainly helped !! cheers , would be looking forward to your content!
@cameronp3157
@cameronp3157 Жыл бұрын
Amazing! Thank you for the explanation dude. It is really helping me with a certification course that I’m taking now
@mrak8948
@mrak8948 Жыл бұрын
imp points: 5:38 contiguous memory 8:28 how are lists diff than Numpy 9:42 applications of numpy 26:17 full and full like
@stoyangeorgiev77
@stoyangeorgiev77 3 жыл бұрын
for the part at 31:50 a = np.zeros((5,5), dtype='int8') a[:,0:5:4], a[0:5:4,:], a[2,2] = 1, 1, 9
@laiqianji7078
@laiqianji7078 Жыл бұрын
Nice mate! What a wonderful review from all the possible uses of Numpy. Thanks a lot!
@avivran1198
@avivran1198 3 жыл бұрын
Thanks for your effort and the good stuff. Effective introductory! Thanks
@judeleon8485
@judeleon8485 3 жыл бұрын
Thanks so much Keith, for the very educating tutorial. Quite explanatory
@SMFahim-vo5zn
@SMFahim-vo5zn 4 жыл бұрын
Just finished it. It was really awesome! I like how you would look at your notes, so that we don't see you 😂. Thanks a lot for this tutorial Keith Galli. Not following any other tutorial on Numpy. Take love!
@nicholasziglio
@nicholasziglio 4 жыл бұрын
Really well put together, thanks! :)
@user-cy3je1xd1c
@user-cy3je1xd1c 3 жыл бұрын
Thank you! The only thing was a little bit complicated to me is working with axis. None the less, great tutorial!
@user-tf1bs6yy3b
@user-tf1bs6yy3b Жыл бұрын
رحؤنشضهكبءخؤذمء ء يددحمس
@PBJYM
@PBJYM 3 жыл бұрын
Thank you bro! This was an amazing tutorial!
@cangulmez9248
@cangulmez9248 2 жыл бұрын
This video improved my numpy information. So thanks everybody who contributed.
@Tradesbycami
@Tradesbycami 11 ай бұрын
Thanks for the free class! I'm just learning programming :) I felt very motivated after I could make the array on Problem #1
@tonyohore288
@tonyohore288 11 ай бұрын
learning as well, would u like a study budy?
@marco.nascimento
@marco.nascimento 4 жыл бұрын
This is a great tutorial, thanks!!
@Luxcium
@Luxcium 4 жыл бұрын
This guy is smart and he makes this stuff really interesting !!! I like it !!!
@san.s.shriyan
@san.s.shriyan 3 жыл бұрын
Even OpenCV a top choice among computer vision professionals uses numpy array to store the image data.... Basically if you know how to manipulate numpy array you can do fine / pixel level operations... really appreciate your video.
@nutellabrownbelt9023
@nutellabrownbelt9023 Жыл бұрын
Super helpful tutorial. When you went back and used -1 indexes instead of exclusive 4's at 33:36 my world stopped imploding. Thank you.
@mechtorious
@mechtorious 3 ай бұрын
Why tho?
@flow2917
@flow2917 Жыл бұрын
great vid, thanks for leaving the little mistakes in there, helps me remember that I dont have to be perfect at this and remember every little thing
@rickpala_
@rickpala_ 4 жыл бұрын
excellent tutorial. feeling comfortable with numpy now thanks to you :)
@rajanalexander4949
@rajanalexander4949 2 жыл бұрын
Excellent pace and explanations -- thank you!
@CzechPatriot1918
@CzechPatriot1918 9 ай бұрын
Watching this at 2x speed so I can learn Numpy in 29 minutes instead of 58 minutes.
@krrishkataria560
@krrishkataria560 4 ай бұрын
i have installed video controller extension, i am watching at 2.5x
@biological-machine
@biological-machine 3 ай бұрын
@@krrishkataria560Just don't watch the video and read the specific documentation. It will be even faster if you have skill.
@rogerknight8092
@rogerknight8092 4 жыл бұрын
Much better than courses that I've paid good money for - Top Man Galli
@robsonsilvadasilva
@robsonsilvadasilva 4 жыл бұрын
The second exercise from last part we can do this as well: a[range(0,4),range(1,5)]
@bhavpreetsingh1842
@bhavpreetsingh1842 3 жыл бұрын
shouldn't the two range functions be in square brackets so as to make them a list
@robsonsilvadasilva
@robsonsilvadasilva 3 жыл бұрын
@@bhavpreetsingh1842 Hello Bhavpreet. I think that is a good practice to use square brackets to read the function, but it`s not necessary. You can test and see that works :)
@akshat2778
@akshat2778 3 жыл бұрын
Even i did the same way ✌️🤟
@lbars
@lbars 3 жыл бұрын
Mine: np.hstack(a[0:4, 1:5])[0:19:5]
@brettnelson7518
@brettnelson7518 3 жыл бұрын
a = Np.arrane([0, 4] [1,5]) is more efficient
@fabrizio.anichini98
@fabrizio.anichini98 3 жыл бұрын
Thanks you Keith , great video (also subscribed to your channel). Also thanks to FCC , love you for your service!
@rafaelgpq
@rafaelgpq Жыл бұрын
Awesome Tutorial. Thank you very much, Keith !
@hasandaaboul5322
@hasandaaboul5322 10 ай бұрын
Really amazing introduction to numpy, it helps a lot Thank you man!
@nakjoonim
@nakjoonim 3 жыл бұрын
Thank you so much for this amazing video!
@steevenkenny9791
@steevenkenny9791 Жыл бұрын
Thank you very much sir... the course is crystal clear... thank you
@tempor8336
@tempor8336 4 жыл бұрын
Thank you dude ! That was great !
@shrikantrane9601
@shrikantrane9601 4 жыл бұрын
Great Tutorial .. can u upload the pandas, scikit learn also.. So we will get the complete basic ml package
@rajdeepchakraborty7961
@rajdeepchakraborty7961 3 жыл бұрын
Also matplotlib
@mohamedgaal5340
@mohamedgaal5340 Жыл бұрын
Thank you Keith for this awesome tutorial!
@justforwork5343
@justforwork5343 2 жыл бұрын
ur tutorial IS AWESOME, plz do more man i also watched ur pandas too and it was as expectedly AWESOME tnx for the help man i appreciate it
@shainamehta408
@shainamehta408 2 жыл бұрын
Thank You for clearing my concepts on NumPy library.
@redviper20
@redviper20 3 жыл бұрын
Here's how you watch these videos: Hover over your right arrow key and hit it when he's initializing or doing some boring stuff, and when something interesting happens, something you might wanna know, you stop, pay attention, maybe type something similar in your own jupyter notebook; continue. Don't watch it at 2x speed. It doesn't work... Reading docs is hard! So this video is really cool.
@epsilonator
@epsilonator 2 жыл бұрын
I did the matrix exercise a bit differently: arr = np.ones((5, 5)) arr[1:-1, 1:-1] = np.zeros((3, 3)) arr[2, 2] = 9
@NinjaTxGaming
@NinjaTxGaming Жыл бұрын
Nice. I noticed, you can also just use 0 instead of np.zeros((3, 3))
@mamadouaw3129
@mamadouaw3129 6 ай бұрын
Best crash course on Numpy ! Thank you for your interesting videos
@PawanKumar-tu6ti
@PawanKumar-tu6ti 3 жыл бұрын
Thanks a lot for this video!! much appreciated really !
@frankservant5754
@frankservant5754 2 жыл бұрын
Thanks bro you I have learnt a TON of stuff from your tutorials
@Yo5463
@Yo5463 4 жыл бұрын
At the end, I indexed [2, 8, 14, 20] as np.delete(a[a%6 == 2], -1) to make use of the cool stair pattern
@artistpw
@artistpw 10 ай бұрын
Love. this. Truly great content and it was even nice to see the little faux pas because everyone has those!
@maryanivanov961
@maryanivanov961 2 ай бұрын
Thanks for this amazing course!!
@ahmedmohammed-zr3hw
@ahmedmohammed-zr3hw 4 жыл бұрын
thank you very much for your efforts,could you talk about pygame with pymunk on details?
@prazzaldebnath5930
@prazzaldebnath5930 3 жыл бұрын
Great tutorial completed full. Love from heart
@mahbleh404
@mahbleh404 4 ай бұрын
one of the best numpy tutorial ever
@RaynerGS
@RaynerGS 3 жыл бұрын
Good job, way to go. Salute from Brazil.
@PrakashRaj-md4wo
@PrakashRaj-md4wo 5 ай бұрын
56:00 b=[ ] for i in range(1,31): b.append(i) c=np.array(b) c=c.reshape(6,5) print(c)
@aneeshkhandelwal3807
@aneeshkhandelwal3807 2 жыл бұрын
Fantastic Tutorial !!!! Loved It !!!
@misketbey
@misketbey 2 жыл бұрын
Very good job, it was very helpful to me, thank you!
@anujdubey7324
@anujdubey7324 4 ай бұрын
Just completed this tutorial. Thanks a lot for the content. Peace Out!!
@sankarmunirathinam115
@sankarmunirathinam115 5 ай бұрын
Awesome Keith, thank you for this great video
@thinhtruong6583
@thinhtruong6583 3 жыл бұрын
thanks for making this video ! It's helpful !
@rohankandra1928
@rohankandra1928 2 жыл бұрын
We can also solve the exercise at 33' using output = np.ones((5,5)) print(output) output[1:4,1:4]=0 print(output) output[2,2]=9 print(output)
@foofoo17
@foofoo17 2 ай бұрын
I solved it in the same way as you :)
@sahilkhandelwal8534
@sahilkhandelwal8534 3 жыл бұрын
Great video . God bless you and you keep making such great videos
@Mushsayer
@Mushsayer 3 жыл бұрын
Thank you very much for sharing the video. It was very helpful.
@huehuehue13
@huehuehue13 2 жыл бұрын
Great video. LOVED IT!
@seekthetruth383
@seekthetruth383 Жыл бұрын
At 31:50 - more compact form: output = np.ones((5, 5), dtype='int8') output[1:4:1, 1:4:1], output[2, 2] = 0, 9 print(output)
@trisolation
@trisolation 4 жыл бұрын
Great video. Thanks!
@DJ-ct6so
@DJ-ct6so 6 ай бұрын
Excellent sir, very well explained !! Many thanks for uploading. 5 stars. ⭐⭐⭐⭐⭐
@bachlam9841
@bachlam9841 3 жыл бұрын
for the 3D array example, if I want to get the [0, 0, :] - [1, 2] and [1, 1, :] - [7, 8] at the same time, will there be any shortcut to do so?
@muhammadmuzammil2140
@muhammadmuzammil2140 4 жыл бұрын
Great video and awesome examples
@bernardopalmer8846
@bernardopalmer8846 2 жыл бұрын
Great video! Just got confused on min 43:55, output 143 should be a sum, but rather we got an array.
@nasser_omar
@nasser_omar 3 жыл бұрын
Thanks a lot, man. You are amazing.
@udyan_upal
@udyan_upal 2 жыл бұрын
completed. thanks man! u r amazing
@TheTechchan
@TheTechchan Жыл бұрын
Thank You! 😊
@Make_Canada_Trudeau-Less-Again
@Make_Canada_Trudeau-Less-Again 4 жыл бұрын
What happened to the live stream, I can't focus anymore!!!
@anshuofficial166
@anshuofficial166 4 жыл бұрын
How to find min and max value in the array recursively with time complexity 3n/2, using a function with two variables minmax(int are[], int size) plzz help
@trrky9
@trrky9 Жыл бұрын
Thank you!
@erenjohn12345
@erenjohn12345 Жыл бұрын
Thank you so much for this video. It helped a lot.
@ahmadnadeem870
@ahmadnadeem870 2 жыл бұрын
could you please share the mode used to draw sildes for this presentation?
@spinipsFI
@spinipsFI Жыл бұрын
Thanks for the tutorial! 👍
@user-fv8gh1yx6h
@user-fv8gh1yx6h 9 ай бұрын
Hey Keith, thanks for this video. I learned a lot! At 19:51, you said the array is "exclusive". What does that mean?
@vthkrl
@vthkrl 3 ай бұрын
means the end index used in the array slicing is excluded from the range. for ex 1:7 would start at index one and end at index 6 because the end index (7) is excluded
@FacuBradaschia
@FacuBradaschia 2 жыл бұрын
Excellent video. Thank you so much.
@apexefficiency
@apexefficiency 4 жыл бұрын
Great Tutorial!!
@cellphoneacademy5454
@cellphoneacademy5454 3 жыл бұрын
Thanks for the awesome video!
@adarshbaderia5846
@adarshbaderia5846 4 жыл бұрын
That was PRETTY amazing. Thankyou. But the most interesting thing was that I was the exact 3k'th like because I liked and unliked the video several times to confirm it.
@negusuworku2375
@negusuworku2375 Жыл бұрын
Thank you. Very helpful.
@arupabarua1721
@arupabarua1721 16 күн бұрын
what a great tutorial!
@saifurrahman3961
@saifurrahman3961 3 жыл бұрын
Thank You Very Much for teaching us this nicely
@alejandrocoronado1131
@alejandrocoronado1131 Жыл бұрын
Thanks man. Great content. Cheers
@sanjr3079
@sanjr3079 3 жыл бұрын
Thnx for these great lessons .😇
@markkennedy9767
@markkennedy9767 6 ай бұрын
Thanks for this primer. At 27:15, can you explain why one would pass integers as two arguments instead of the tuple as an argument (as was done for previous arguments of methods). It all seems kinda hit and miss. At 28:50, why would the key be size, and not shape? Why do we use ~ and & instead of "not" and "and" for the conditions. At 31:20, does this mean we should pass lists with double square brackets generally to np.array() to ensure we have sufficient axes so that we have the option to repeat both rows and columns if we want to. At 46:15, can you explain why the argument for vstack has square brackets around v1,v2. It actually makes no sense syntactically since these outside square brackets should create another dimension on top of the two dimensions that [[v1],[v2]] already have. But vstack just stacks rows; it doesn't create another dimension. So it shouldn't work, yet it does- more syntactic nonsense 😄. At 51:30, datatype > 50 is actually an np array of Booleans so why should this work when we pass this np array as an index for the datatype array. So far, we have only seen integers used for indexing arrays e.g. array [ : , 2] etc yet here magically passing an array as an index works! More syntactic nonsense. Python seems so made up. What exactly is the extent of the types of objects that can be used for indexing arrays. Edit: I see you explained just after that it's because lists can index arrays in numpy, fair enough. Maybe you can offer an explanation. Thank again for this
@avinashsingh1642
@avinashsingh1642 4 жыл бұрын
For 57:07, could you do a for loop such as this?: for i in range(0,3): a[i, i+1] then output would be a[0,1], a[1,2], a[2,3], a[3,4] right?
@kahramonjuraev156
@kahramonjuraev156 4 жыл бұрын
no, it ends with a[2,3]
@cyprianadler9098
@cyprianadler9098 Жыл бұрын
Hey. In minute 51:28 he explains how you can generate a new array with all the values over 50. Is there a elegant way of creating a new array with all the indeces of values over 50 instead of the values?
@soumyasrm
@soumyasrm 4 жыл бұрын
Pls make tutorial for model deployment end to end
@shamsmehdi3725
@shamsmehdi3725 3 жыл бұрын
very very helpful. thank you!
@aliceinbath2850
@aliceinbath2850 2 ай бұрын
Thanks for this video!!
@jaypatil4912
@jaypatil4912 4 жыл бұрын
Hello! is this video also covers the Scipy ?
NumPy vs SciPy
7:56
IBM Technology
Рет қаралды 28 М.
Ultimate Guide to NumPy Arrays - VERY DETAILED TUTORIAL for beginners!
24:23
YouTube's Biggest Mistake..
00:34
Stokes Twins
Рет қаралды 66 МЛН
[Vowel]물고기는 물에서 살아야 해🐟🤣Fish have to live in the water #funny
00:53
didn't want to let me in #tiktok
00:20
Анастасия Тарасова
Рет қаралды 10 МЛН
КИРПИЧ ОБ ГОЛОВУ #shorts
00:24
Паша Осадчий
Рет қаралды 6 МЛН
Learn NUMPY in 5 minutes - BEST Python Library!
13:38
Python Programmer
Рет қаралды 815 М.
Основы NumPy Python | Массивы, Матрицы И Операции Над Ними
38:26
PyLounge - программирование на Python и всё о IT
Рет қаралды 100 М.
NumPy vs Pandas
5:55
IBM Technology
Рет қаралды 128 М.
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 575 М.
NumPy for Beginners in 15 minutes | Python Crash Course
17:23
Nicholas Renotte
Рет қаралды 37 М.
Functions in Python are easy 📞
10:38
Bro Code
Рет қаралды 362 М.
GPT-4o Deep Dive: the AI that CRUSHES everything
28:11
AI Search
Рет қаралды 49 М.
Numpy Tutorial in Hindi
56:18
CodeWithHarry
Рет қаралды 810 М.
YouTube's Biggest Mistake..
00:34
Stokes Twins
Рет қаралды 66 МЛН