Complete Python NumPy Tutorial (Creating Arrays, Indexing, Math, Statistics, Reshaping)

  Рет қаралды 776,646

Keith Galli

Keith Galli

Күн бұрын

Check out stratascratch.com/?via=keith to practice your Python Pandas data science skills!
This video overviews the NumPy library. 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. A full video timeline can be found in the comments.
Link to code used in video: github.com/KeithGalli/NumPy
Feel free to watch at 1.5x to learn more quickly!
If you enjoyed this video, please consider subscribing :).
Let me know your feedback and what I should make a video on next.
----------------------------
Videos of mine that use NumPy
- Creating Connect 4 Game: • How to Program Connect...
- Plotting (with some use of NumPy): • Intro to Data Visualiz...
- Generating Mock Data: • Generating Mock Data w...
----------------------------
Links with more information!
NumPy vs Lists:
jakevdp.github.io/blog/2014/0...
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...
----------------------------
Video Timeline!
0:00 - Introduction
1:15 - What is NumPy
1:35 - NumPy vs Lists (speed, functionality)
9: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?)
---------------------
If you are curious to learn how I make my tutorials, check out this video: • How to Make a High Qua...
Join the Python Army to get access to perks!
KZbin - / @keithgalli
Patreon - / keithgalli
*I use affiliate links on the products that I recommend. I may earn a purchase commission or a referral bonus from the usage of these links.

Пікірлер: 544
@KeithGalli
@KeithGalli Жыл бұрын
I created a second channel with more Python content, check it out!😊 kzbin.info
@Noartisthere
@Noartisthere 3 жыл бұрын
I'm a 38-year-old starting to learn coding and an interest in machine learning. Your easily understandable videos are a huge help for beginners like myself.
@dunzek943
@dunzek943 3 жыл бұрын
Keep going my man. Learning only stops after you die!
@investandcyclecheap4890
@investandcyclecheap4890 3 жыл бұрын
I just started myself ! This one was really great! I liked the problems at the end
@LC-wv7tz
@LC-wv7tz 3 жыл бұрын
I'm 28 and learning all this too. My degree is in physics and mathematics, but I have very little coding experience. I just got hired for a job. The hiring process and application was very strange, extremely vague. Long story short, after a month it's become apparent to me that while my job title says "physicist", the work my department is doing is much closer to data science, data analysis, and the occasional modeling and simulation. Learning all this stuff makes for a good use of the mandatory telework days, though.
@techtbe
@techtbe Жыл бұрын
Me too
@muralidhar40
@muralidhar40 4 ай бұрын
Hi man, I am 35, from India, and I m in the same boat as u.
@leaddiet
@leaddiet 3 жыл бұрын
As a newbie, I deeply appreciate you showing an error you got on the fly and voicing your thought process while you resolved it. That is something I don’t typically see in tutorials or pre-recorded lessons and it’s really great to have a chance to mirror someone’s thought process while still developing your own techniques. 10/10
@maganaluis92
@maganaluis92 4 жыл бұрын
I've been using Numpy for 3 years and this is quite informative for me. Pay attention guys.
@mad8ry
@mad8ry 3 жыл бұрын
may I ask you what kind of job you do? I have learned python and I have a solid understanding about it, but I don't know which way to go
@FirstnameLastname-ys1up
@FirstnameLastname-ys1up 3 жыл бұрын
@@mad8ry go somewhere. Go where you can.
@mad8ry
@mad8ry 3 жыл бұрын
@@FirstnameLastname-ys1up Is this suppose to mean something?
@FirstnameLastname-ys1up
@FirstnameLastname-ys1up 3 жыл бұрын
@@mad8ry it means you are lost.
@shervintheprodigy6402
@shervintheprodigy6402 3 жыл бұрын
@@FirstnameLastname-ys1up BRO I do ML videos and even this is informativer for me!!
@GreyBandanna
@GreyBandanna 4 жыл бұрын
Nice to see these new and fresh tutorials. Biologist here, learning all the Python I can for data analysis in my spare time. Your presentation of the documentation makes the information invaluably easy to understand, really. Thank you very much
@smolboyi
@smolboyi 4 жыл бұрын
I love the density of data given in this video and the inclusion of mistakes in the code writing, thank you greatly!
@antoniatsvetanova8288
@antoniatsvetanova8288 Жыл бұрын
I am a PhD student in Statistics, but currently a ML intern at Microsoft and your videos are the only thing that help me transition from the statsy R-coding world to Python. Thank you!
@KeithGalli
@KeithGalli Жыл бұрын
Very happy to hear that! :)
@juliesampson162
@juliesampson162 3 жыл бұрын
Keith - thanks so much for spending your time to make these helpful and time-saving videos for folks such as myself who are learning new skills and technologies. The structure is straightforward and not oversimplified. Also, thanks for not inflating them with unnecessary complexity! I really appreciate the format of a background + "api walk-through" style and the inclusion of a selectable timeline for the option to pick and choose what I need for me at the moment. You rock dude!
@suryamgupta4467
@suryamgupta4467 3 жыл бұрын
This is an incredible video on Numpy, covering sooo many basic things and explaining them so freaking well. I have been on this video since 3 days, continuously learning from this video, documentation, geeksforgeeks, stackoverflow, also made 7 programs myself to try out every method myself and I have enjoyed every single moment. Thank you so much man!
@willalston9627
@willalston9627 4 жыл бұрын
I've been teaching myself Python and ran into your videos the other day. The delivery was informative and entertaining in its simplicity. Thank you: great videos!
@millionwolves
@millionwolves 4 жыл бұрын
No one has ever kept it this simple and straight. You saved me a lot of time. Keep up the good work !
@xyzzyx9357
@xyzzyx9357 4 жыл бұрын
After searching a lot, finally I found a great tutorial on numpy with everything I want to learn. Thanks a lot sir.
@tempura_edward4330
@tempura_edward4330 3 жыл бұрын
Hi Keith just wanna say thank you very much for this video!! After watching your video, I went from no experience with pandas and little knowledge of python programming to now learning data science in a bootcamp! This video really changed my life!👍👍🌟🌟
@ksrajavel
@ksrajavel 3 жыл бұрын
Simply the best tutorial for a beginner!!! Taking time to introduce the numpy.reshape function( happened at 75th percentile of the video) is very great!!! Many tutorials just jump right into the reshape function. Thanks a lot Keith Galli
@howkre8ive
@howkre8ive 3 жыл бұрын
This was extremely helpful! I appreciate the fact your video was organized into individual lessons. I'm an old guy just learning python/numpy. Thank you for your time!
@zana3d
@zana3d 2 жыл бұрын
Thank you so much for this. I am 44 years old making the transition to Data Analysis and enjoying the lessons. I struggled with the final assignment at the end so I hope more practice will help me grasp the concepts better. Cheers.
@hellothere9298
@hellothere9298 Жыл бұрын
Thank you for the great course but most of all thank you for not being messy and going every where. Most tutorials dont follow any logic and jump from one thing to another without any logical line Definitely the BEST tutorial i have watched !
@KashyapBhat
@KashyapBhat 4 жыл бұрын
I dont know how you you did it, but its difficult for me to sit in a code lecture for 1 hour and I understood and was lively till the end of this video. Love it man thanks. ❤️
@Boringpenguin
@Boringpenguin 3 жыл бұрын
This tutorial is great, thank you so much! Just an extra note about Problem #2 For the second question, we can also get the offsetted diagonal by the following neat way: np.diag(a, k=1) where k specifies the number of offset, the default will be k=0
@SyedAli-sx6gh
@SyedAli-sx6gh 4 жыл бұрын
Great tutorial man, really helped me understand the library
@sreekanthreddy5998
@sreekanthreddy5998 4 жыл бұрын
This the very first channel that I've seen such a clear explanation
@anthonygrear6226
@anthonygrear6226 3 жыл бұрын
I'm glad you included the quiz. I actually need to slice a 2D matrix diagonally, and then the solution just appeared! All around good video.
@nataliabarbaramantillabeni6129
@nataliabarbaramantillabeni6129 3 жыл бұрын
Excellent tutorial! Thank you very much! I really appreciated that you provide a clear and concise overview of a broad number of topics that are critical to getting started.
@mikeaheirwe7157
@mikeaheirwe7157 2 жыл бұрын
Amazing video! Thank you so much. I'm 37 and have started tinkering with coding and python. It's so much fun!
@misterjava2926
@misterjava2926 4 жыл бұрын
I am currently going through your data Science Playlist. Thank you very much. This was even better than the Pandas Tutorial. You should include small tasks an questions in all of your tutorials.
@JLSXMK8
@JLSXMK8 3 жыл бұрын
14:50 You can also compare the itemsize function results as well; This can come in useful when figuring out how much relative space one data type uses over another; Along with the thing that @Keith Galli says, you can also print stuff such as print(a.itemsize < b.itemsize), or print(b.itemsize - a.itemsize).
@dileepsathyan9001
@dileepsathyan9001 4 жыл бұрын
Helps me during the lockdown study hours. Thanks Keith!
@Ar68assar
@Ar68assar 4 жыл бұрын
Great video! A video on curve fitting using python would be much appreciated 🙏
@shreyaskalrao9779
@shreyaskalrao9779 4 жыл бұрын
Veryyyyyyy helpful. Went through your Pandas tutorial as well yesterday. Got many doubts cleared! Helping me be productive in the lockdown. Thanks xD
@samuelmcdonagh1590
@samuelmcdonagh1590 3 жыл бұрын
Sat through this taking notes, 500 lines of notes and code. Fantastic video, thanks.
@melihsafacelik1166
@melihsafacelik1166 4 жыл бұрын
I watched linear algebra (4 min with x2) part and thank you for your great video. Great effort.
@neptunesbounty1786
@neptunesbounty1786 4 жыл бұрын
Getting me through lockdown!
@KeithGalli
@KeithGalli 4 жыл бұрын
Glad to hear it! Stay safe & healthy friend :)
@SimonYells
@SimonYells 2 жыл бұрын
I'm halfway through the video and so far so good. Nice tutorial !
@IndrainKorea
@IndrainKorea 4 жыл бұрын
Great tutorial man! I watched it till the end, the tutorial is really well structured and also informative! Thank you very much!
@meganamedeo3612
@meganamedeo3612 3 жыл бұрын
super informative. I'm currently taking a class for data science and this video REALLY helped! felt like i learned more from you than my class.
@BrntVanilla
@BrntVanilla 4 жыл бұрын
Wonderful video man! Been a while since I last used NumPy and this was a great refresher!
@kayveekhatrao2486
@kayveekhatrao2486 4 жыл бұрын
Definitely content worth watching and learning during this lockdown Thank You.
@jamesjohnathan4424
@jamesjohnathan4424 3 жыл бұрын
Awesome tutorial, simple n clear. Keep up the good work!!!
@InfinitesimallyInfinite
@InfinitesimallyInfinite 4 жыл бұрын
Congratulations... 10k subs.... keep the good work up!
@jimtitus8431
@jimtitus8431 4 жыл бұрын
Awesome tutorial man! Just subscribed. Keep 'em coming
@joeasmar4197
@joeasmar4197 3 жыл бұрын
You made it so easy! Thank you. Will definitely be using this video as a reference in the future. Keep up the great work :)
@luisvera8431
@luisvera8431 4 жыл бұрын
Thanks Keith! i found this tutorial very helpful and easy to follow
@cyberloh
@cyberloh 3 жыл бұрын
i been afraid i'm to bad with maths to look at data science - really. but now i seen your vids, thanks so much man! that's all so easy
@kushagrak960
@kushagrak960 4 жыл бұрын
You don't know how much you helped me with your Numpy and pamdas videos. Thanks a ton bro. God bless you. Lots of respect ❤️
@KeithGalli
@KeithGalli 4 жыл бұрын
Really happy to hear that man! You're very welcome :)
@KeithGalli
@KeithGalli 4 жыл бұрын
Video Timeline! Background Info 1:15 - What is NumPy 1:35 - NumPy vs Lists (speed, functionality) 9:17 - Applications of NumPy Code 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?) Thank you for watching! Hope you enjoyed and let me know if you have any questions! Subscribe pls if you haven't
@keegan7736
@keegan7736 4 жыл бұрын
helpful cheers
@JR-gy1lh
@JR-gy1lh 4 жыл бұрын
Keith Galli, I know this is specific to Numpy, this is a pandas specific question. If I wanted to convert a column in place of a DataFrame from byte type |S32 to string what's the best way to do this. I've been unsuccessful in changing the datatype in place using applymap from |S32 to as string. I'm using a library that create DataFrames in which strings are typecast to bytes.
@tejasnareshsuvarna7948
@tejasnareshsuvarna7948 4 жыл бұрын
Hello Keith Galli. I made notes for your Video. The video was really good. thank you. docs.google.com/document/d/1Pk13GuHdKotR0SR3PFsi0MzpMzj1m4bo9DEllm9tsrY/edit?usp=sharing
@deepakSharma-db6fj
@deepakSharma-db6fj 4 жыл бұрын
you missed the np.arange.reshape, which was part of the basic ..... but good job
@madhuchandragiri4391
@madhuchandragiri4391 4 жыл бұрын
Make video on pandas, matplotlib & datascience
@shashankshekhar1956
@shashankshekhar1956 3 жыл бұрын
one of the best video on numpy that covers all the fundamental operations by numpy...... highly recommendable for learners 😊😊
@alexwu7111
@alexwu7111 3 жыл бұрын
this video is very good for beginners. its because you can know more about Numpy and know how to convert numbers in programming.
@shankarnarayananiyer5296
@shankarnarayananiyer5296 4 жыл бұрын
Great content. The concept is explained in a steady pace and great reasoning. A new subscriber from India.
@acquaviva_doxa5335
@acquaviva_doxa5335 2 жыл бұрын
Thanks, I needed this simple and organized background. Now I can build from here. Thanks again.
@lifehacks4everyone
@lifehacks4everyone 4 жыл бұрын
Awesome tutorial Keith!!! Thanks a lot for sharing your knowledge with us! !!!!
@mampiisaotaku
@mampiisaotaku 4 жыл бұрын
hi! just wanted to say that ur videos are helping a lot. i just started to learn python for fun, aaaaaaaaaaaaaand it appears that it is helping a a lot in my job. it makes things way easier. AND THANKS TO YOU, i can learn thing more faster. wish you the best mate.
@chasec.1799
@chasec.1799 3 жыл бұрын
Great Videos, I am starting to learn so much about Python because of all of your great videos. Thanks Keith.
@diegopereyra9
@diegopereyra9 4 жыл бұрын
When extracting the green diagonal of the matrix in the last excercice you can actually use np.diag(a,k=1)
@hsiang-yehhwang2625
@hsiang-yehhwang2625 4 жыл бұрын
I learned a lot from this video. Thanks for creating and sharing it!!
@jifengzhang3863
@jifengzhang3863 2 жыл бұрын
This was indeed useful, thank you Keith for making it!
@HazemAzim
@HazemAzim 2 жыл бұрын
Probably the best explaining NumPy ! Thank you
@Nikos_rebetis
@Nikos_rebetis 4 жыл бұрын
great video. I really enjoy your tutoriel about connect 4, how to make the game step by step. Step by step's (not particularly game) tuto are very appreciable
@mayurshinde7443
@mayurshinde7443 Жыл бұрын
This was super helpful, Thanks Keith!
@pawanpu3202
@pawanpu3202 4 жыл бұрын
Nice tutorial was waiting for this since so many days😊 Thank you so much love from India ❤️
@KeithGalli
@KeithGalli 4 жыл бұрын
You're welcome! :)
@hectormotsepe1581
@hectormotsepe1581 3 жыл бұрын
Thank you, Keith Galli Keep up the good work
@umeshbatra3783
@umeshbatra3783 4 жыл бұрын
Just one word, Awesome. Delivered the content with so much ease. Looking forward for some more videos on Data Science :) :). Already subscribed
@KeithGalli
@KeithGalli 4 жыл бұрын
Aww thanks :)
@seebbe8148
@seebbe8148 4 жыл бұрын
Thank's, I learned a lot and it's really easy to follow along and it's really clean
@lesegokgatshe6051
@lesegokgatshe6051 4 жыл бұрын
I am new in Data Science and i would like to thank Keith for his informative videos, he's simply the best
@mercygachokawairimu
@mercygachokawairimu 4 жыл бұрын
Same here....
@nishantshri97
@nishantshri97 4 жыл бұрын
very helpful video ,love from india,i watched pandas video yesterday ,today i searched for numpy ,i am luckiiiii that u uploaded just 1 day back.Please make some more video on Datascience
@jpaldama9963
@jpaldama9963 4 жыл бұрын
I did NOT know you can 'put' matrix 'inside' a larger matrix like the way you demonstrated. That was real awesome. my jaw dropped and started laughing. This math world i live in makes learning and programming so much more better and insightful. 3 hours passed after I finished my data session. Thanks for the prime grade content!
@JamesJon1187
@JamesJon1187 2 жыл бұрын
THanks for the vid! Besides the clear and simple teaching, the interspersed questions were great!
@thehanke
@thehanke 4 жыл бұрын
*pulls plug off the back of the neck* *NEO's voice, in my head, right now* "I know NumPy" Awesome video mate. Cheers for sharing this.
@zedor1553
@zedor1553 3 жыл бұрын
lolol
@lxlx19
@lxlx19 4 жыл бұрын
Tks Keith. you're a great teacher. It was enlightening. Greetings from Brazil
@rounakmanghnani4495
@rounakmanghnani4495 4 жыл бұрын
Thank you Keith for such an amazing video.
@bindiyamenon3837
@bindiyamenon3837 4 жыл бұрын
Excellent tutorial Keith. Thank you :)
@nimeesha0550
@nimeesha0550 3 жыл бұрын
Great Job Keith! Helped me a lot. Thanks a ton!
@user-yw2rd6hq5y
@user-yw2rd6hq5y 2 жыл бұрын
thank you so much! i just start using python, and it really help me.
@martintoilet5887
@martintoilet5887 3 жыл бұрын
Short but informative, also showed how powerful NumPy is.
@martinchen6213
@martinchen6213 4 жыл бұрын
thanks you very much , really helpfully for the beginner as well as for refreshing the basic concepts in python
@anitachen8887
@anitachen8887 3 жыл бұрын
Awesome tutorial !!! Many thanks!! Already liked and subscribed !
@xavierfournat8264
@xavierfournat8264 3 жыл бұрын
Brilliant piece of content. Most valuable way to spend 55min of your time!
@tatinenidheerajchowdhary3223
@tatinenidheerajchowdhary3223 4 жыл бұрын
This is excellent stuff👏 Thanks brother❤
@ghanashyamtalwalkar6366
@ghanashyamtalwalkar6366 3 жыл бұрын
Found your NumPy tutorial very helpful...Thanks!!!
@axeyohole4133
@axeyohole4133 4 жыл бұрын
That test at the very end was awesome.
@KiranSharma-ey6xp
@KiranSharma-ey6xp 2 жыл бұрын
Thanks for sharing, had saw Pandas and NumPy tutorials, useful information covered in tutorial videos 👍
@SMFahim-vo5zn
@SMFahim-vo5zn 4 жыл бұрын
Just finished it on FreeCodeCamp and came here to give it a like. Looking for more videos like this! Take love!
@hussainabbas1341
@hussainabbas1341 3 жыл бұрын
Thank you very much, You did this tutorial as a professional.
@ronweasley5573
@ronweasley5573 2 жыл бұрын
This was simple, short, easy to understand while covering all major topics! plus if you know pandas then it's more easy ;)
@subhajitadhikary155
@subhajitadhikary155 3 жыл бұрын
awesome video keith, really helped me a lot with numpy for a beginner like me U are doing great job
@endtropi
@endtropi Жыл бұрын
Very useful tutorial! Really helped me. keep on!
@Burakyesilvlogs
@Burakyesilvlogs 3 жыл бұрын
Great Video. Thanks for the overview of NumPy.
@priyanshugupta7591
@priyanshugupta7591 3 жыл бұрын
this was much better than the courses on coursera or udemy, thx for the indepth knowledge you provided.
@AddyKanhere
@AddyKanhere 4 жыл бұрын
Very informative and well structured!! You just earned my Sub :)
@niyousha6868
@niyousha6868 4 жыл бұрын
Thank you Thank you Thank you.... I watched almost all your channel videos in this quarantine. I learned a lot. I just wanted to say thanks.
@KeithGalli
@KeithGalli 4 жыл бұрын
You're welcome! :)
@VSH077
@VSH077 3 жыл бұрын
Very good video. Self explanatory. Thanks a lot for bringing this up.
@ravihunsa
@ravihunsa 4 жыл бұрын
very nice Keith Galli, worth session to the beginners to learn Numpy library. Thanks
@staaron5542
@staaron5542 4 жыл бұрын
Thanks very much. Very helpful video. Keep making more mate!!!
@shankar3109
@shankar3109 4 жыл бұрын
Awesome dude. subscribed and thumbed up :)
@mojahiddool
@mojahiddool 4 жыл бұрын
This is really very useful, many thanks for the lecture.
@poojaarora4873
@poojaarora4873 3 жыл бұрын
Very well explained. Thankyou so much.
@Kirouqx_
@Kirouqx_ Жыл бұрын
thanks, it actually let me through so i could download it.
@jatinkumar4410
@jatinkumar4410 3 жыл бұрын
Very nice and informative tutorial. Very nicely organized. Thanks a lot...
@gustavovaldivia6160
@gustavovaldivia6160 3 жыл бұрын
Thank you so much, this what I was looking for
@alexandrag9435
@alexandrag9435 2 жыл бұрын
Great examples! Thank you!!!
@kanefoster8780
@kanefoster8780 3 жыл бұрын
Great content! Incredibly helpful, thanks a lot
Solving real world data science tasks with Python Pandas!
1:26:07
Keith Galli
Рет қаралды 1,5 МЛН
Ultimate Guide to NumPy Arrays - VERY DETAILED TUTORIAL for beginners!
24:23
Trágico final :(
01:00
Juan De Dios Pantoja
Рет қаралды 33 МЛН
1🥺🎉 #thankyou
00:29
はじめしゃちょー(hajime)
Рет қаралды 27 МЛН
Como ela fez isso? 😲
00:12
Los Wagners
Рет қаралды 24 МЛН
NumPy vs SciPy
7:56
IBM Technology
Рет қаралды 29 М.
How Many ERRORS Can You Fit in a Video?!
20:40
ElectroBOOM
Рет қаралды 530 М.
SciPy Tutorial (2022): For Physicists, Engineers, and Mathematicians
1:33:29
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 585 М.
Exploratory Data Analysis with Pandas Python
40:22
Rob Mulla
Рет қаралды 417 М.
NumPy Crash Course - Complete Tutorial
1:02:44
Patrick Loeber
Рет қаралды 110 М.
NumPy vs Pandas
5:55
IBM Technology
Рет қаралды 130 М.
NumPy Tutorial (2022): For Physicists, Engineers, and Mathematicians
1:32:42