Python NumPy Tutorial for Beginners

Поділитися
Вставка
  • Опубліковано 2 лют 2025

КОМЕНТАРІ • 603

  • @gokul8747
    @gokul8747 4 роки тому +547

    ⭐️ 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?)

  • @shritishaw7510
    @shritishaw7510 3 роки тому +33

    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

  • @cram2208
    @cram2208 5 років тому +66

    Seriously, side-by-side comparisons are the BEST !! As visual as it can get ! 🙏

  • @SK-zl3qg
    @SK-zl3qg 3 роки тому +50

    Absolute clarity and upto speed. Very comprehensive coverage.

    • @63khushalsolanki9
      @63khushalsolanki9 3 роки тому +11

      Thats the most english I have heard all day

    • @shdnas6695
      @shdnas6695 2 роки тому

      @@63khushalsolanki9 lol

    • @agam1823
      @agam1823 7 місяців тому

      @@63khushalsolanki9 real

  • @TheNotoriousFonzy
    @TheNotoriousFonzy 3 роки тому +88

    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.

  • @jozbornn
    @jozbornn 4 роки тому +145

    This was a phenomenal overview of numpy. I feel confident that I can tackle more advanced topics now!

  • @uiiuiiui1732
    @uiiuiiui1732 2 роки тому +11

    ⭐ 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?)

  • @oluwaseunakanbi8317
    @oluwaseunakanbi8317 2 місяці тому +1

    I like the way he explains slowly and navigates around the software slowly for a beginner to grasp. Much better than those who say they want to train beginners yet rush the whole thing as if they are teaching intermediate. And the screen display is clear; not faint.
    Thumbs up 👍.

  • @cornelius600
    @cornelius600 5 років тому +405

    1.25 speed is perfect, thanks for the video

  • @redviper20
    @redviper20 4 роки тому +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.

  • @bluegtturbo
    @bluegtturbo 5 років тому +40

    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...

  • @bikraji
    @bikraji 2 роки тому +2

    Here is another NumPy tutorial I created which you may like: ua-cam.com/video/KrWcRePnq8U/v-deo.html

  • @nutellabrownbelt9023
    @nutellabrownbelt9023 2 роки тому +4

    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.

  • @nemesis_rc
    @nemesis_rc 4 роки тому +36

    One of the finest Numpy tutorials. Keep up the great work guys!

    • @Blinkers2007GameDev
      @Blinkers2007GameDev 5 місяців тому

      Agreed! Learned alot by writing down

    • @nemesis_rc
      @nemesis_rc 5 місяців тому

      @@Blinkers2007GameDev bro i myself forgot numpy after 3 years 😂, need to rewatch the video to recall the important concepts, thanks for the comment as it reminded me to rewatch the tutorial

    • @rickyfatty363
      @rickyfatty363 5 місяців тому

      @@nemesis_rc I forgot it after 3 months

  • @stoyan____g
    @stoyan____g 4 роки тому +37

    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

  • @smiley-wu1kn
    @smiley-wu1kn 2 роки тому +15

    This is the first tutorial that I actually finished. Thank you, Keith!

  • @rogerknight8092
    @rogerknight8092 5 років тому +8

    Much better than courses that I've paid good money for - Top Man Galli

  • @flow2917
    @flow2917 2 роки тому +6

    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

  • @arthurgomberg164
    @arthurgomberg164 3 роки тому +13

    Well done. Quick ,short & straight to the point!

  • @DeepakRai
    @DeepakRai 3 роки тому

    Random Permutation in Numpy will be available at ua-cam.com/video/e84SB_4qAjM/v-deo.html

  • @Luxcium
    @Luxcium 5 років тому +13

    This guy is smart and he makes this stuff really interesting !!! I like it !!!

  • @mrak8948
    @mrak8948 2 роки тому +37

    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

  • @cangulmez9248
    @cangulmez9248 3 роки тому

    This video improved my numpy information. So thanks everybody who contributed.

  • @fabrizio.anichini98
    @fabrizio.anichini98 4 роки тому +6

    Thanks you Keith , great video (also subscribed to your channel). Also thanks to FCC , love you for your service!

  • @Tradesbycami
    @Tradesbycami Рік тому +4

    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 Рік тому

      learning as well, would u like a study budy?

  • @TheWolf9777
    @TheWolf9777 6 місяців тому +3

    You are really great, the effort in your code is impeccable.

  • @SMFahim-vo5zn
    @SMFahim-vo5zn 5 років тому +6

    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!

  • @oteikwufrancis1108
    @oteikwufrancis1108 6 місяців тому +3

    4 years counting and this video's still a blast 😂😂
    Could have given it 2 👍👍 if i could but, UA-cam only allows one so 👍
    Ps.
    I'm so checking out your video on pandas

    • @Teena-rl7oc
      @Teena-rl7oc 6 місяців тому

      You can actually give two likes by another account lol

  • @tonyhathuc
    @tonyhathuc 4 роки тому +18

    This is absolutely great content! Thank you so much for doing this!

  • @rohanphilip2001
    @rohanphilip2001 2 роки тому

    ⭐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?)

  • @PrakashRaj-md4wo
    @PrakashRaj-md4wo Рік тому

    56:00
    b=[ ]
    for i in range(1,31):
    b.append(i)
    c=np.array(b)
    c=c.reshape(6,5)
    print(c)

  • @dohkang3725
    @dohkang3725 2 роки тому +3

    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 :)

  • @markkennedy9767
    @markkennedy9767 Рік тому +1

    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

  • @steevenkenny9791
    @steevenkenny9791 2 роки тому +7

    Thank you very much sir... the course is crystal clear... thank you

  • @mamadouaw3129
    @mamadouaw3129 Рік тому

    Best crash course on Numpy ! Thank you for your interesting videos

  • @jifjw_jifwk_ska
    @jifjw_jifwk_ska Рік тому +28

    Watching this at 2x speed so I can learn Numpy in 29 minutes instead of 58 minutes.

    • @krrishkataria560
      @krrishkataria560 Рік тому +2

      i have installed video controller extension, i am watching at 2.5x

    • @biological-machine
      @biological-machine 11 місяців тому +3

      @@krrishkataria560Just don't watch the video and read the specific documentation. It will be even faster if you have skill.

    • @davekush3171
      @davekush3171 2 місяці тому

      Skip the first 9 min

  • @mahbleh404
    @mahbleh404 Рік тому

    one of the best numpy tutorial ever

  • @TheZipzapzum
    @TheZipzapzum 2 роки тому +1

    Answer for 31:34
    import numpy as np
    a=np.ones((5,5),dtype='int8')
    b=np.zeros((3,3),dtype='int8')
    a[1:-1,1:-1]=b
    a[2,2]=9
    print(a)

    • @anuragparcha4483
      @anuragparcha4483 2 роки тому

      You don't need to create b. It just wastes memory. Just do this:
      i5 = np.ones((5,5))
      i5[1:4,1:4] = 0
      i5[2,2] = 9
      print(i5)

  • @cameronp3157
    @cameronp3157 2 роки тому +3

    Amazing! Thank you for the explanation dude. It is really helping me with a certification course that I’m taking now

  • @LeNgocTrang-ui3iw
    @LeNgocTrang-ui3iw 11 днів тому

    THANK YOU SO MUCH omg best python lecture ever

  • @laiqianji7078
    @laiqianji7078 2 роки тому +1

    Nice mate! What a wonderful review from all the possible uses of Numpy. Thanks a lot!

  • @rafaelgpq
    @rafaelgpq 2 роки тому +1

    Awesome Tutorial. Thank you very much, Keith !

  • @rajanalexander4949
    @rajanalexander4949 2 роки тому +2

    Excellent pace and explanations -- thank you!

  • @Ak-wo5wu
    @Ak-wo5wu 3 роки тому

    Thanks

  • @hasandaaboul5322
    @hasandaaboul5322 Рік тому +1

    Really amazing introduction to numpy, it helps a lot
    Thank you man!

  • @Musiclover-qh1uf
    @Musiclover-qh1uf 6 днів тому

    Timestamps (Powered by Merlin AI)
    00:01 - NumPy is essential for scientific computing and data science in Python.
    02:15 - Computers read information in bytes and Numpy uses less memory space.
    06:47 - Numpy utilizes contiguous memory for performance benefits
    09:03 - NumPy allows for item-wise computations and has various powerful applications.
    13:34 - Understanding vector dimensions and memory allocation in NumPy arrays.
    15:58 - Access and modify specific elements in a 2D NumPy array
    20:05 - Reassigning elements and indexing in NumPy arrays
    22:15 - Indexing and replacing elements in NumPy arrays
    26:28 - Generate random arrays using NumPy
    28:43 - numpy.random for generating random numbers and arrays.
    33:10 - NumPy array slicing and copying
    35:09 - Using numpy's copy function and performing element-wise arithmetic operations
    39:15 - Understanding matrix operations and multiplication
    41:20 - Numpy provides functions for performing linear algebra operations like finding determinant and eigenvalues of a matrix.
    45:30 - Explained vertical and horizontal stacking in NumPy arrays.
    47:31 - Load data from a text file into a numpy array without using pandas
    51:35 - NumPy allows indexing with lists and performing boolean operations on arrays.
    53:50 - Boolean masking and advanced indexing in NumPy
    58:08 - Understanding the NumPy library for Python

  • @SuleymanAbubeker
    @SuleymanAbubeker 5 місяців тому +2

    when I start the video I have no idea about the numpy but now at the end of the video I can do things in numpy

  • @frankservant5754
    @frankservant5754 3 роки тому

    Thanks bro you I have learnt a TON of stuff from your tutorials

  • @RaynerGS
    @RaynerGS 4 роки тому +2

    Good job, way to go. Salute from Brazil.

  • @shainamehta408
    @shainamehta408 3 роки тому

    Thank You for clearing my concepts on NumPy library.

  • @DeepakYadav-t3q
    @DeepakYadav-t3q Рік тому

    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!

  • @rickpala_
    @rickpala_ 4 роки тому +3

    excellent tutorial. feeling comfortable with numpy now thanks to you :)

  • @nicholasziglio
    @nicholasziglio 4 роки тому +6

    Really well put together, thanks! :)

  • @faihasan2020
    @faihasan2020 3 місяці тому

    Really great review on NumPy. Thanks for explaining such an easier way.

  • @lifeofsanjai
    @lifeofsanjai 2 роки тому

    50:00
    test = np.genfromtxt('sample.txt', delimiter=',', dtype = 'int32')
    This too works

  • @Александр-р3э3м
    @Александр-р3э3м 3 роки тому +13

    Thank you! The only thing was a little bit complicated to me is working with axis. None the less, great tutorial!

  • @luism5822
    @luism5822 4 роки тому +1

    The first 11 minutes of the video have really useful info

  • @diananggreini5089
    @diananggreini5089 2 роки тому +1

    Thank you for the video, its help me a lot to understand the concept and the function

    • @easydatascience2508
      @easydatascience2508 2 роки тому

      welcome to check my playlists also. I made most of the videos for Python and R. easy to follow.

  • @justforwork5343
    @justforwork5343 3 роки тому

    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

  • @37even
    @37even 5 років тому +3

    I pressed the thumb up twice as you wanted

  • @DJ-ct6so
    @DJ-ct6so Рік тому

    Excellent sir, very well explained !! Many thanks for uploading. 5 stars. ⭐⭐⭐⭐⭐

  • @anujdubey7324
    @anujdubey7324 Рік тому

    Just completed this tutorial. Thanks a lot for the content. Peace Out!!

  • @dev.regotube
    @dev.regotube 4 роки тому +5

    56:02
    how to make the array:
    p1 = np.zeros((6,5), dtype='int8')
    x = 0
    for i in range(6):
    for j in range(5):
    x+=1
    p1[i,j] = x

  • @mohamedgaal5340
    @mohamedgaal5340 2 роки тому

    Thank you Keith for this awesome tutorial!

  • @CoreyHillesheim
    @CoreyHillesheim 2 роки тому

    31:50
    def init_array(rows, columns):
    p = np.zeros((rows, columns), dtype='int8')
    p[0,:] = p[-1,:] = p[:,0] = p[:,-1] = 1
    p[p.shape[0]//2, p.shape[1]//2] = 9
    return(p)
    init_array(5,5)

  • @NaJoeLibre
    @NaJoeLibre 7 місяців тому

    Really useful video! Been using Pandas for a couple years but learning Numpy is showing me why Pandas does the things it does.

  • @san.s.shriyan
    @san.s.shriyan 3 роки тому +1

    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.

  • @ahsamyousaf436
    @ahsamyousaf436 7 місяців тому

    what a descriptive video on numpy 👍👍👍

  • @arnavchauhan9637
    @arnavchauhan9637 8 місяців тому

    amazing lecture by amazing teacher⭐⭐⭐⭐⭐

  • @robsonsilvadasilva
    @robsonsilvadasilva 5 років тому +38

    The second exercise from last part we can do this as well: a[range(0,4),range(1,5)]

    • @bhavpreetsingh1842
      @bhavpreetsingh1842 4 роки тому +2

      shouldn't the two range functions be in square brackets so as to make them a list

    • @robsonsilvadasilva
      @robsonsilvadasilva 4 роки тому +2

      @@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 4 роки тому

      Even i did the same way ✌️🤟

    • @lbars
      @lbars 4 роки тому +1

      Mine: np.hstack(a[0:4, 1:5])[0:19:5]

    • @brettnelson7518
      @brettnelson7518 3 роки тому

      a = Np.arrane([0, 4] [1,5]) is more efficient

  • @epsilonator
    @epsilonator 3 роки тому +10

    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 2 роки тому +2

      Nice. I noticed, you can also just use 0 instead of np.zeros((3, 3))

  • @ankitchoudhary197
    @ankitchoudhary197 4 роки тому +1

    31:50
    p = np.ones((5,5),dtype='int32')
    p[1:4,1:4] = 0
    p[2,2] = 9

  • @judeleon8485
    @judeleon8485 4 роки тому +1

    Thanks so much Keith, for the very educating tutorial. Quite explanatory

  • @rohankandra1928
    @rohankandra1928 3 роки тому +4

    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 11 місяців тому

      I solved it in the same way as you :)

  • @suranjanasarkar517
    @suranjanasarkar517 2 місяці тому

    Thank you for clearing my concepts.

  • @sankarmunirathinam115
    @sankarmunirathinam115 Рік тому

    Awesome Keith, thank you for this great video

  • @artistpw
    @artistpw Рік тому

    Love. this. Truly great content and it was even nice to see the little faux pas because everyone has those!

  • @minhducaaa
    @minhducaaa Рік тому

    Thank you for the useful content. The very quick start with numpy.

  • @avivran1198
    @avivran1198 4 роки тому

    Thanks for your effort and the good stuff. Effective introductory! Thanks

  • @user-fw3vv4id5z
    @user-fw3vv4id5z Рік тому

    I'm here because I'm doing a course where the teacher can't even explain what this is... and it's part of the program 🙄 ... Thank you so much for your tutorials, I also did the Pandas one the other day (again, my teacher failed to explain it properly) and I understood everything with your video!!

  • @cyprianadler9098
    @cyprianadler9098 2 роки тому +1

    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?

  • @maryanivanov961
    @maryanivanov961 11 місяців тому

    Thanks for this amazing course!!

  • @TechnoWithAndy
    @TechnoWithAndy 2 роки тому

    Fantastic Tutorial !!!!
    Loved It !!!

  • @PedramGhassemi
    @PedramGhassemi 6 місяців тому

    exactly what i was looking for

  • @multicreativehub396
    @multicreativehub396 2 місяці тому

    Still Nice after 5 years. Thanks

  • @NguyenVanThucK18HL
    @NguyenVanThucK18HL 7 місяців тому

    great video about numpy. Thank you a lot and hope that you can make more video like this ones

  • @K_SE_Arpan
    @K_SE_Arpan 4 роки тому

    Awesome work dude.
    love from India

  • @Danfabour
    @Danfabour 3 місяці тому

    thanks you so much man, the video helped me a lot

  • @JohnCanniff
    @JohnCanniff 4 роки тому +1

    @29:00 is def apart of my process while coding.

  • @nasser_omar
    @nasser_omar 4 роки тому +1

    Thanks a lot, man. You are amazing.

  • @sherhlms2295
    @sherhlms2295 6 місяців тому

    31:36
    ap=np.ones((5, 5), dtype='int16')
    ap[1, 1:4]=0
    ap[3, 1:4]=0
    ap[2, 1:4:2]=0
    ap[2, 2]=9
    print(ap)

  • @everydaynormalguy3194
    @everydaynormalguy3194 3 роки тому

    33:47
    I made a shorter one from your tips
    import numpy as np
    a=np.ones((5,5))
    a[1:4,1:4]=[[0,0,0],[0,9,0],[0,0,0]]
    print(a)

  • @antaryaami172
    @antaryaami172 2 роки тому +1

    Great video👏 thank you

  • @BlitzHitz
    @BlitzHitz 8 місяців тому

    Thank you for uploading this.

  • @FerrisMcLaren
    @FerrisMcLaren 5 років тому +6

    I recommend 1.5 speed. Great video!

  • @solomonadim3112
    @solomonadim3112 5 місяців тому

    Thanks for this video Keith

  • @734833
    @734833 2 роки тому

    Really good information delivery.

  • @wildertapiasaenz2333
    @wildertapiasaenz2333 Рік тому

    Omg I wish you had been teaching my programming class 😁

  • @udyan_upal
    @udyan_upal 3 роки тому

    completed. thanks man! u r amazing

  • @sandie_jr
    @sandie_jr 3 роки тому

    Thnx for these great lessons
    .😇