NumPy Crash Course - Complete Tutorial

  Рет қаралды 116,213

Patrick Loeber

Patrick Loeber

Күн бұрын

Get my Free NumPy Handbook:
www.python-engineer.com/numpy...
Learn NumPy in this complete 60 minutes Crash Course! I show you all the essential functions of NumPy, and some tricks and useful methods. NumPy is the core library for scientific computing in Python. It is essential for any data science or machine learning algorithms.
~~~~~~~~~~~~~~ GREAT PLUGINS FOR YOUR CODE EDITOR ~~~~~~~~~~~~~~
✅ Write cleaner code with Sourcery: sourcery.ai/?... *
📚 Get my FREE NumPy Handbook:
www.python-engineer.com/numpy...
📓 Notebooks available on Patreon:
/ patrickloeber
⭐ Join Our Discord : / discord
If you enjoyed this video, please subscribe to the channel!
Timestamps:
00:00 - Overview
01:59 - NumPy Introduction
03:30 - Installation and Basics
08:00 - Array vs List
12:06 - Dot Product
15:52 - Speed Test array vs list
17:54 - Multidimensional (nd) arrays
22:09 - Indexing/Slicing/Boolean Indexing
29:37 - Reshaping
32:40 - Concatenation
36:16 - Broadcasting
38:26 - Functions and Axis
41:50 - Datatypes
44:03 - Copying
45:15 - Generating arrays
48:05 - Random numbers
51:29 - Linear Algebra (Eigenvalues / Solving Linear Systems)
01:00:04 - Loading CSV files
You can play around with the notebook here:
github.com/patrickloeber/pyth...
Data Loading with NumPy:
• How To Load Machine Le...
My Machine Learning Tutorials with NumPy:
• Machine Learning from ...
NumPy Official site:
numpy.org/
You can find me here:
Website: www.python-engineer.com
Twitter: / patloeber
GitHub: github.com/patrickloeber
#Python
----------------------------------------------------------------------------------------------------------
* This is a sponsored link. By clicking on it you will not have any additional costs, instead you will support me and my project. Thank you so much for the support! 🙏

Пікірлер: 138
@raminessalat9803
@raminessalat9803 3 жыл бұрын
School is a waste of time when youtubers like him exist!
@patloeber
@patloeber 3 жыл бұрын
hehe thanks :)
@Addistoday
@Addistoday Жыл бұрын
school is school cant compare, how can u get organized lesson on youtube for all subs, how you know which youtuber does it all?
@great_marshal
@great_marshal 11 ай бұрын
Lol, that anger 😂
@azad2546421
@azad2546421 3 ай бұрын
@@patloeber Sir, the handbook is not available.
@SrijanChakraborty
@SrijanChakraborty 2 жыл бұрын
Amazing tutorial. Best use of my time. I was always apprehensive about getting started with python. This is exactly what I needed.
@Ethan-po8ji
@Ethan-po8ji Жыл бұрын
Spent some hours to watch all content. It really helps a lot!!! Thank you!!
@user-ek6eo6ly9j
@user-ek6eo6ly9j 5 ай бұрын
I have seen lots of tutorials of Numpy but I must say this one is just Amazing. Keep it up :)
@eyalpery8470
@eyalpery8470 3 ай бұрын
I liked this video a lot. I followed it by coding with you and also using GPT4 to fill my mathematical gaps. I especially liked the linear system example.
@kaizhang9530
@kaizhang9530 Жыл бұрын
thank you. watched this video in one take , felt great!
@slashtool
@slashtool 2 жыл бұрын
Thank you very much. This tutorial is perfect for a matlab programmer to learn numpy very quickly.
@avishijain803
@avishijain803 11 ай бұрын
this is the best u can get in an hour !!! thanks man for letting your heart out.
@krugerbrent4270
@krugerbrent4270 Жыл бұрын
Thank you Patrick, it is a very well made video. Learned a lot of useful numpy actions.
@vamsirahul
@vamsirahul 2 жыл бұрын
Very helpful! Thank you for making this!
@Soundbeforelight
@Soundbeforelight 3 жыл бұрын
Thanks for this awesome tutorial. It's just what I needed to jump start my use of NumPy and I like how you followed a general flow with the NumPy : the Absolute Basics for Beginners documentation. I just learn better through visuals so this was perfect. I especially appreciated when you gave some insights as to when you'd use a certain method, like with indexing and filtering. I'm new to DS and ML so that added context is awesome! More of that please! Thank you!!!
@patloeber
@patloeber 3 жыл бұрын
Thanks! Really glad you like it :)
@ninadgandhi9040
@ninadgandhi9040 10 ай бұрын
Love it. Feels like Señor chang is teaching!
@Param3021
@Param3021 2 жыл бұрын
Thanks for this Numpy Crash Course Sir. It's really great, and you have explained very well in this tutorial.😊
@logicpulse360
@logicpulse360 11 ай бұрын
Huge thanks for such a concise video.
@omar-elgammal
@omar-elgammal 8 ай бұрын
Very practical and to the point explaination ! thanks a lot
@patloeber
@patloeber 4 жыл бұрын
If you want to play around with the code, you can find my notebook here: github.com/patrickloeber/python-engineer-notebooks
@arnokyro5352
@arnokyro5352 Жыл бұрын
Thank you so much
@milfordjohnson2289
@milfordjohnson2289 Ай бұрын
thanks to fantastic use of technology and resources... now the entire planet feels really good about whats to come. good for you
@milfordjohnson2289
@milfordjohnson2289 Ай бұрын
the more i learn, the more i am appreciate about learning, the more i can put learning to good use.... and the more quality of life and ongoing strengthening and growth of the individual i experience. it is almost as if my time is worth nowhere near a fraction of yours, like some kind of silly goose ... i consider myself now dumber than 6 years ago. that is how much growth ive experienced.
@swagatabhattacharya7686
@swagatabhattacharya7686 3 жыл бұрын
Thanks! That was clear and to the point! Good crash course!
@patloeber
@patloeber 3 жыл бұрын
Thank you :)
@rvjenya
@rvjenya 3 жыл бұрын
You are awesome 🌟 Thanks for your fantastic video. You have an immense talent for teaching.
@kheeleshpoonye6443
@kheeleshpoonye6443 2 жыл бұрын
Hello, thank you so much for the video; really useful and helpful! Quick question please: at 21:21, why is the determinant not exactly equal to -2? I am thinking it has to do with the int64 property, but I am not sure.
@alexio98COD
@alexio98COD 9 ай бұрын
Thanks a lot for this free video!!
@VinayRajapuram
@VinayRajapuram 3 жыл бұрын
This is brilliantly explained! Thanks alot!! 👍🏼
@patloeber
@patloeber 3 жыл бұрын
thanks :)
@LucianoPinheiro78
@LucianoPinheiro78 2 жыл бұрын
Man, that's just wonderful to find this linear system notation, and numpy linear functions
@patloeber
@patloeber 2 жыл бұрын
glad you like it!
@interesting_stuffs
@interesting_stuffs Жыл бұрын
exponentially valued content! 🎉
@monsieur_piyushsingh
@monsieur_piyushsingh 3 жыл бұрын
first time enjoyed a tutorial this much
@patloeber
@patloeber 3 жыл бұрын
Really glad to hear that!
@mohammadzeinaghaji2499
@mohammadzeinaghaji2499 3 жыл бұрын
Thanks. Why autocomplete does not work on objects returned from Numpy method?
@UditiChawla
@UditiChawla Жыл бұрын
Wonderful lecture. Just have one doubt, I dont understand the use of newaxis, since we already have reshape that can achieve the same results.Is there an example maybe where newaxis is used and reshape cant be used to achieve the same results?
@fawadjamshidi9402
@fawadjamshidi9402 Жыл бұрын
thank you for your awesome video bro 😘
@adipurnomo5683
@adipurnomo5683 3 жыл бұрын
13:22 Sir, why we place print(dot) outside for loop?
@dodmedium
@dodmedium 9 ай бұрын
Excellent tutorial, thanks! Just one comment: you refer to some resources that should be linked in the descriptions (e.g., data loading tutorial), but are not there. Maybe you could add a comment saying where they can be found now.
@rohanroy5873
@rohanroy5873 3 жыл бұрын
Thank you so much for the crash course👌🏻
@patloeber
@patloeber 3 жыл бұрын
Sure! Glad you enjoyed it
@zipcomps1741
@zipcomps1741 3 жыл бұрын
great summary, thank you!
@patloeber
@patloeber 3 жыл бұрын
Very welcome!
@yeah6732
@yeah6732 11 ай бұрын
from my end. instead of appending, a + np.array(4) adds 4 to each element in my NumPy array. Why not using np.append(a,4)?
@andrewalphones8769
@andrewalphones8769 5 ай бұрын
many thanks buddy.
@ariamirsh
@ariamirsh 3 жыл бұрын
Many thanks for this. Absolutely amazing coverage and explanation.
@patloeber
@patloeber 3 жыл бұрын
Glad you enjoyed it!
@DanDascalescu-dandv
@DanDascalescu-dandv 2 ай бұрын
28:58 needs better explanation
@user-co6pu8zv3v
@user-co6pu8zv3v 2 жыл бұрын
Thank you!
@code_japi
@code_japi 7 ай бұрын
Thank You!
@rimtapaswi670
@rimtapaswi670 Жыл бұрын
Thank you sir ..
@markkennedy9767
@markkennedy9767 8 ай бұрын
At 41:20, thanks for pointing out, as an aside, how something like a.max() can also be used as a function np.max(a). For the life of me, though, I can't understand why there are two ways to do operations like these in python especially since they do exactly the same thing. I mean, both leave the a untouched (they don't change it in place) so I don't know why np.max(a) with reassignment isn't the unique way of doing it.
@BN-hy1nd
@BN-hy1nd 11 ай бұрын
I have Numpy version 1.25.1. So why do I get int32 for dtype. I am just starting numpy
@raminessalat9803
@raminessalat9803 3 жыл бұрын
Great video! I was wondering what was the difference between the fancy indexing and using np.argwhere? it seemed that both get the considered indices
@patloeber
@patloeber 3 жыл бұрын
fancy indexing can take a list of all indices. argwhere takes a condition..
@vishnuvardhanreddysyamala3654
@vishnuvardhanreddysyamala3654 3 жыл бұрын
Very helpful. Thanks a lot. All concepts in a nutshell. God Bless yoo.
@patloeber
@patloeber 3 жыл бұрын
thanks :)
@joy2000cyber
@joy2000cyber 2 жыл бұрын
I love the dark background, easy to stare at the screen and concentrate.
@patloeber
@patloeber 2 жыл бұрын
glad you like it!
@fatemehsharifaskari6956
@fatemehsharifaskari6956 2 жыл бұрын
(base) -MBP ~ % import numpy as np zsh: command not found: import I am getting this massage. How to slove?
@jabbbadahutt
@jabbbadahutt Жыл бұрын
What application is he using to write the code?
@mohamedachrafelmansouri3181
@mohamedachrafelmansouri3181 7 ай бұрын
Thank you a lot my friend. May God lead you to the right path.
@ansariaburehan263
@ansariaburehan263 Ай бұрын
thank youuu
@spencersedano
@spencersedano 10 ай бұрын
9:21 the error was because of the numpy, am I right? Great tutorial, still watching it!
@afrinmerchant9619
@afrinmerchant9619 3 жыл бұрын
You saved me ! Thanks a lot. Liebe Grüße aus Magdeburg
@patloeber
@patloeber 3 жыл бұрын
Danke :) Grüße zurück
@God_For_A_Reason
@God_For_A_Reason Жыл бұрын
At 29:29 , why not simply do print(a[a%2==0])
@IsfhanAhmed
@IsfhanAhmed 3 жыл бұрын
thanks for your time for us
@patloeber
@patloeber 3 жыл бұрын
Sure :)
@pythonicman6074
@pythonicman6074 2 жыл бұрын
الف شكر صراحه انت مبدع
@DanDascalescu-dandv
@DanDascalescu-dandv 2 ай бұрын
28:58 couod explain step by step what .argwhere outputs, and what .flatten dies to that output
@balakrishnakumar1588
@balakrishnakumar1588 4 жыл бұрын
Thanks Enjoyed numpy crash course, any possible to get a torch crash course ?
@patloeber
@patloeber 4 жыл бұрын
thanks! For now I have a full beginner course. Maybe I add a little crash course, too...
@markkennedy9767
@markkennedy9767 8 ай бұрын
At 18:10, it would have been nice if you explained what exactly the (2,) stood for when we have just one dimension: it seems like it stands for two rows and no columns, if you go by the syntax for the shape of multidimensional arrays. But that would mean it's an array "standing up", which is the transpose of what we typed in. So i suspect it means no rows and two columns, i.e an array "lying down", i.e. exactly what we typed in. Also, any idea why the transpose is just an attribute of the object i.e. a.T, whereas the diagonal is a full numpy function called on the object a i.e np.diag(a). To a beginner, or even intermediate user, it seems totally random and inconsistent when one uses methods and when one use functions, and also whether those functions are directly from the module np. e.g. np.diag or from an intermediate object e.g. np.linalg.det etc. It amounts to committing everything to memory. I thought the whole point of coding was that it was more elegant and consistent than this.
@SrijanChakraborty
@SrijanChakraborty 2 жыл бұрын
Excellent video! I learnt so much. I did have a question thought. In the section for data types you gave us an example with a 1D array. Suppose we need to force the datatype for a 2D array, what would be the syntax in that scenario? I tried yours but it did not take.
@chinecheremojekwu7090
@chinecheremojekwu7090 Жыл бұрын
it would be like this: import numpy as np a = np.array([[1,2,3],[4,5,6]],dtype=np.int32) print(a.dtype)
@abhishekkumarmishras6373
@abhishekkumarmishras6373 3 жыл бұрын
it seems you are very kindhearted you make subject very love able thanks please upload pandas tutorial too.
@patloeber
@patloeber 3 жыл бұрын
Thanks 😊
@a-aronpaulluminding3133
@a-aronpaulluminding3133 3 жыл бұрын
Genius!
@foxooo
@foxooo 2 жыл бұрын
19:02 : why do the rows not display as 2 and not '3'. Not sure how that make sense but the column number shows as 3. Anyone care to explain?
@archanaranganathan3081
@archanaranganathan3081 2 жыл бұрын
a.shape gives the output (2,3). where 2 is the number of rows and 3 is the number of columns in a, [ 1 2 3 ] row 1 [ 3 4 8 ] row 2
@CompilationError
@CompilationError 3 жыл бұрын
thanks. 😍😍
@incognito-ik9rh
@incognito-ik9rh 3 жыл бұрын
so in indexing slicing, we never take the first element into account?
@patloeber
@patloeber 3 жыл бұрын
of course you can take the first element into account. x[0:4] gives you elements 0, 1, 2, and 3
@tassoskat8623
@tassoskat8623 Жыл бұрын
Greetings! Why use hstack or vstack instead of concatenate? Concatenate seems to do the job for both of those.
@criquetvert749
@criquetvert749 Жыл бұрын
yes indeed ! I guess programmers like simpler functions, same with np.zeros and np.ones that could be replaced with np.full
@JoseManuelValdeolmillos
@JoseManuelValdeolmillos 4 жыл бұрын
Thanks!! Please! What extensions or plugins you use in visual studio code for python?
@patloeber
@patloeber 4 жыл бұрын
I'll make a video about this in the next few days :)
@kiwi-mf2do
@kiwi-mf2do 8 ай бұрын
This feels like excel but with more steps. Noob here, Any reason we cant do these things in Excel?
@wells111able
@wells111able 3 жыл бұрын
thank you very much
@patloeber
@patloeber 3 жыл бұрын
You are welcome
@jalilio5065
@jalilio5065 2 жыл бұрын
Do u have a video for pandas?
@Kig_Ama
@Kig_Ama 3 жыл бұрын
Great tutorial. By the is there a reason why u don't use pycharm as IDE?
@patloeber
@patloeber 3 жыл бұрын
both are great :)
@aabidh5270
@aabidh5270 Жыл бұрын
Which notebook is he using?
@akalankasakalasooriya
@akalankasakalasooriya 3 жыл бұрын
thank you sir
@patloeber
@patloeber 3 жыл бұрын
you're welcome
@kidsmedia1102
@kidsmedia1102 3 жыл бұрын
I almost complete the practicing today.....
@vxsniffer
@vxsniffer Жыл бұрын
13:40 using range + index to loop iterables is not pythonic... in this case zip() function allows looping two lists in the same time.
@Kig_Ama
@Kig_Ama 3 жыл бұрын
5:40 I made it exactly the same way u did, but I get int32 instead of int64. My version of numpy is 1.19.3. Why did u get int64 and I get int32?
@mohsinansari8271
@mohsinansari8271 3 жыл бұрын
possibly because you are either using 32-bit OS or installed 32-bit version of software running python script
@Kig_Ama
@Kig_Ama 3 жыл бұрын
@@mohsinansari8271 Ty mohsin. Actually I have a Win 10 64-bit PC. What do u mean by software? I am using Python 3.9, my ide is pycharm.
@mohsinansari8271
@mohsinansari8271 3 жыл бұрын
@@Kig_Ama check if pycharm is 32-bit. I checked numpy documentation and it said "The desired data-type for the array. If not given, then the type will be determined as the minimum type required to hold the objects in the sequence." You can always force to int64 though.
@Kig_Ama
@Kig_Ama 3 жыл бұрын
@@mohsinansari8271 My pycharm should be 64 bit, at least thats what it says when I look it up by clicking About in the menu Help. Could it be that this is some weird windows issue? I found this here at stackoverflow: _"Default integer type __np.int__ is C long....But C long is int32 in win64."_
@mohsinansari8271
@mohsinansari8271 3 жыл бұрын
@@Kig_Ama Yes probably some OS related issue. Dont bother too much. Its not an actual "issue" though.
@damianmarciniec1756
@damianmarciniec1756 Жыл бұрын
generating arrays
@arminehayrapetyan3373
@arminehayrapetyan3373 4 жыл бұрын
Nice tutorial. Can we get the code used in crash course (maybe some github link)?
@patloeber
@patloeber 4 жыл бұрын
there you go :) github.com/python-engineer/python-engineer-notebooks
@arminehayrapetyan3373
@arminehayrapetyan3373 3 жыл бұрын
@@patloeber thank you!
@manikanthreddy1087
@manikanthreddy1087 4 ай бұрын
why didn't i know this guy before....
@vivekpandian08
@vivekpandian08 4 жыл бұрын
Kindly do a video for Pandas also like this.
@patloeber
@patloeber 4 жыл бұрын
Will definitely be added in the future :)
@vivekpandian08
@vivekpandian08 4 жыл бұрын
@@patloeber Thanks
@SanyAnnieJohn
@SanyAnnieJohn 3 жыл бұрын
Thanku SO mUCh..Please add Pandas too..
@patloeber
@patloeber 3 жыл бұрын
yes this is on the list
@kidsmedia1102
@kidsmedia1102 3 жыл бұрын
I'm practicing .......
@abuazfaar3662
@abuazfaar3662 3 жыл бұрын
Are you German cause Your accent is kind of one. Well thanks for this amazing crash course.
@patloeber
@patloeber 3 жыл бұрын
Yep I’m German. Can’t hide my accent 😅
@abuazfaar3662
@abuazfaar3662 3 жыл бұрын
@@patloeber hey, hope you didn't take this as offensive. Coincidentally, I was bored and I started watching Conan's(comedian) videos of berlin. From there I got the idea. BTW, I love Germany, its a dream destination for me. Love and peace from India. And I apologize if you find it offensive.
@patloeber
@patloeber 3 жыл бұрын
No worries :) yeah you should come visit
@Kig_Ama
@Kig_Ama 3 жыл бұрын
Why wasn't list in Python developed the way Numpy works?
@hallo-xp2wh
@hallo-xp2wh 2 жыл бұрын
Both work differently also list is quick when dealing with small data whereas NumPy is quick at dealing large data
@Kig_Ama
@Kig_Ama 2 жыл бұрын
@@hallo-xp2wh ty!
@Jaeoh.woof765
@Jaeoh.woof765 10 ай бұрын
32:55 😀
@raseshshetty2386
@raseshshetty2386 3 жыл бұрын
Pandas Tutorial plz
@patloeber
@patloeber 3 жыл бұрын
Will definitely come in the future!
@Bartek-wn8rm
@Bartek-wn8rm Жыл бұрын
Good but you could explain these complicated math things
@milfordjohnson2289
@milfordjohnson2289 Ай бұрын
i think this is a fantastic use of python. the learning has been learned, no need for anybody else to be impressed with learning. we need more coal miners :)
@yryt3223
@yryt3223 4 жыл бұрын
Hey, how can I talk to you? Can you give your Telegram?
@patloeber
@patloeber 3 жыл бұрын
not yet. I have Twitter. But I play to add another chat messenger in the future.
@falakkhan4886
@falakkhan4886 Жыл бұрын
Great content. No offense but u sound like male Janice.
@klaymen5736
@klaymen5736 Жыл бұрын
У канала selfedu в разы качественнее курс по NumPy
@Vipul_775
@Vipul_775 10 күн бұрын
Awesome course..must to go with🔥🫶🫶
@sayantaniguha8519
@sayantaniguha8519 Жыл бұрын
Topics not that clear - slicing of 2d arrays, np.newaxis, np.random(random vS randn - especially the 'meaning of distribution'), linalg part(involving eigenvalues and allclose) module
6 Tips to write BETTER For Loops in Python
9:19
Patrick Loeber
Рет қаралды 247 М.
NumPy vs Pandas
5:55
IBM Technology
Рет қаралды 142 М.
Дарю Самокат Скейтеру !
00:42
Vlad Samokatchik
Рет қаралды 8 МЛН
Nutella bro sis family Challenge 😋
00:31
Mr. Clabik
Рет қаралды 14 МЛН
WHAT’S THAT?
00:27
Natan por Aí
Рет қаралды 13 МЛН
NumPy for Beginners in 15 minutes | Python Crash Course
17:23
Nicholas Renotte
Рет қаралды 42 М.
Ultimate Guide to NumPy Arrays - VERY DETAILED TUTORIAL for beginners!
24:23
Scientific Concepts You're Taught in School Which are Actually Wrong
14:36
How I would learn Machine Learning (if I could start over)
7:43
AssemblyAI
Рет қаралды 749 М.
Learn NUMPY in 5 minutes - BEST Python Library!
13:38
Python Programmer
Рет қаралды 834 М.
Learn NumPy In 30 Minutes
31:54
Patrick Loeber
Рет қаралды 30 М.
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30
Rob Mulla
Рет қаралды 263 М.
Pandas for Data Science in 20 Minutes | Python Crash Course
23:06
Nicholas Renotte
Рет қаралды 117 М.
Python NumPy Tutorial for Beginners
58:10
freeCodeCamp.org
Рет қаралды 1,5 МЛН
Genetic Algorithms Explained By Example
11:52
Kie Codes
Рет қаралды 317 М.
Дарю Самокат Скейтеру !
00:42
Vlad Samokatchik
Рет қаралды 8 МЛН