numpy tutorial - basic array operations

Поделиться
HTML-код
  • Опубликовано: 23 дек 2024

Комментарии • 94

  • @codebasics
    @codebasics  2 года назад +4

    Do you want to learn python from me with a lot of interactive quizzes, and exercises? Here is my project-based python learning course: codebasics.io/courses/python-for-beginner-and-intermediate-learners

  • @OmkarShelke-w2j
    @OmkarShelke-w2j Год назад +3

    this is awesome dhaval sir, You covered the entire important topics of numpy in just 10 minutes live without any editor and with simply idle. Keep uploading the videos sir.

  • @abhilashmishra9127
    @abhilashmishra9127 7 лет назад +38

    watch at speed:1.5x. The video is really cool at that speed. Thanks codebasics for the wonderful video. I was searching for one of these types of videos for quite a while.

    • @mcsangveer
      @mcsangveer 7 лет назад +4

      Lol I watch all videos at 1.5.I get bored at any speed lower than that

    • @marcd4144
      @marcd4144 7 лет назад +4

      You might have some sort of attention disorder. That might not work out so well in real life.

    • @mcsangveer
      @mcsangveer 7 лет назад

      Neither does being dumb

    • @marcd4144
      @marcd4144 7 лет назад

      vignesh ramesh You mad bro?

    • @mcsangveer
      @mcsangveer 7 лет назад

      Marc D no you?

  • @38Fanda
    @38Fanda 2 года назад +1

    hello mister pajeet I want to thank you from the bottom of my heart for this wonderful tutorial

  • @codebasics
    @codebasics  5 лет назад +1

    Step by step roadmap to learn data science in 6 months: ruclips.net/video/H4YcqULY1-Q/видео.html
    Learn data science with pandas: ruclips.net/video/CmorAWRsCAw/видео.html
    Machine learning tutorials with exercises:
    ruclips.net/video/gmvvaobm7eQ/видео.html

  • @liordah0
    @liordah0 7 лет назад +20

    bro u vids are dank af

  • @NickMaverick4
    @NickMaverick4 Год назад

    Thanks to codebasic, thanks to dhaval sir, super easy to understand and practice..❤

  • @frankservant5754
    @frankservant5754 3 года назад

    Thank you man you are a lifesaver for real

  • @harshamejari
    @harshamejari Год назад +1

    print('very nice teaching

  • @zerostudy7508
    @zerostudy7508 5 лет назад +1

    ahaha i like your language style "You Obviously Don't Remember. But If You Open Your Calculator You'll Find The Square Root It's Gonna Be This!". haha i'll tell that to my elementary teacher one day. Best Quote dank af

  • @harinarayananvenkateswaran3241
    @harinarayananvenkateswaran3241 5 лет назад +1

    nice and useful video. thank you

  • @VivekYadav-ds8oz
    @VivekYadav-ds8oz 5 лет назад +1

    If you need to create the Python lists to initialize the numpy arrays, i.e if you have to do np.array( *[1,2,3]* ) then you have to make the python list in memory first before passing it to numpy array method, if I'm not mistaken. How does then numpy manage to be faster then??

    • @codebasics
      @codebasics  5 лет назад +1

      You are right Vivek that it makes python list first but that is just to initialize numpy array. After it is initialized the list will go out of scope and garbage collected. After that it is pure native numpy array with all it's optimizations such as strict data type, contiguous memory locations etc. Hence it is going to be faster.

  • @GOODLUCK-vo7jr
    @GOODLUCK-vo7jr 3 года назад

    thankyou sir learn python with your helpful video

    • @codebasics
      @codebasics  3 года назад +1

      Glad it was helpful!

    • @GOODLUCK-vo7jr
      @GOODLUCK-vo7jr 3 года назад

      @@codebasics sir i learn all basic of python datascience with your videos and other source but sir i have no certifiacte of any kind of like python or data scienece how i get job sir pls help..

  • @DhanushA-p2c
    @DhanushA-p2c Год назад

    Thanks a lot sir ,for such great lecture😇

  • @mitsudipta
    @mitsudipta 11 месяцев назад

    Does linearly spaced array include the upper bound ?

  • @SulemanTheTraveller
    @SulemanTheTraveller 3 года назад

    Excellent, to the point lecture

  • @webapplicationguide3798
    @webapplicationguide3798 7 лет назад +1

    Thank You !! In 10:52 , You said sqrt is not a function. it's a generic function. what does that mean ?
    can you elaborate ?

    • @webapplicationguide3798
      @webapplicationguide3798 7 лет назад

      Thank You !!

    • @brotherlui5956
      @brotherlui5956 6 лет назад

      np.sqrt() is a class method and not an instance method, well explained here: realpython.com/blog/python/instance-class-and-static-methods-demystified/

  • @upendrad6081
    @upendrad6081 6 месяцев назад

    Thanks for your effort

  • @mcsangveer
    @mcsangveer 7 лет назад

    Excellent video.Lots of love.

  • @manishkc3852
    @manishkc3852 4 года назад

    Why there are no jupyter notebook links in the any video of numpy playlist? @codebasics

  • @umarfarooq805
    @umarfarooq805 2 года назад

    My array.itemsize shows 8 bytes for both int64 and float64 data types?

  • @slickwillie3376
    @slickwillie3376 4 года назад

    Thx. It was a great tutorial. I made a help module out of it so I would remember it all. 😃

  • @quickedits94
    @quickedits94 Год назад

    I miss doing your exercises!!! Good lecture tho.

  • @hpourmamih
    @hpourmamih 4 года назад

    same as always this course is very useful as well !!! Thanks BRO...

  • @shreedharchavan7033
    @shreedharchavan7033 3 года назад

    Great tutorial

  • @izharkhankhattak
    @izharkhankhattak 4 года назад

    Good one. Thank you, Sir.

  • @shreyassbagi2538
    @shreyassbagi2538 6 лет назад

    a=np.zeros((2,3,4)) what is the third number 4 do the array ?

  • @Shivam_kishor
    @Shivam_kishor 2 года назад

    Thankyou sir ❤️❤️

  • @krantikiranmayig8564
    @krantikiranmayig8564 3 года назад

    How to load google sheets csv file using Numpy?

  • @Hany_AlShahhat
    @Hany_AlShahhat 5 лет назад

    very helpful tutorials , thanks

  • @BioxyTube
    @BioxyTube 6 лет назад

    thanks a lot :)...really clear explanations

  • @codingart6859
    @codingart6859 4 года назад

    this is wonderfull

  • @prabhatsharma3551
    @prabhatsharma3551 2 года назад

    What's linspace I didn't got it can someone help me with that pls.

  • @abdullahyahya2471
    @abdullahyahya2471 6 лет назад +4

    Love you man #noHomo.

  • @saranshkhurana7784
    @saranshkhurana7784 5 лет назад

    thanks man. it was great

  • @yasarhussain3811
    @yasarhussain3811 6 лет назад +1

    Excellent

  • @MPmang-d1f
    @MPmang-d1f 7 лет назад

    great vid man thanks!

  • @paragjp
    @paragjp 6 лет назад

    Hi Can you pl explain what is a difference between flatten and ravel ? Secondly a=np.array([1,2,3,4])
    t=np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]])
    print(a)
    print(t)
    a.itemsize
    a.ndim When it runs in jupyter notebook in single cell it shows output of a.ndim only. Can you pl explain me why ?

  • @pathummudannayake6947
    @pathummudannayake6947 6 лет назад

    Thanks. Very helpuful

  • @wsgsantos
    @wsgsantos 6 лет назад

    Thank you again sir!

  • @remoman23
    @remoman23 6 лет назад

    What is the significance between data types like ‘uint8’ and ‘uint32’ other than the amount of memory they take up?

    • @twilighttucson2526
      @twilighttucson2526 5 лет назад

      Black Schroeder they determine maximum value or precision on the case if floats

  • @Saph498
    @Saph498 7 лет назад

    How can I import two CSV files, called a.CSV and b.CSV, each includes a 64 by 64 matrice and then do the calculations on them? for example a-b ?

  • @shiridisaivadla2235
    @shiridisaivadla2235 4 года назад

    where as in reshapping a nparray you forgot to tell onething the shape whatever we gave & and the product of x&y must be eqals to the total noof elements

  • @abdul-ur-rehmanchattha9874
    @abdul-ur-rehmanchattha9874 4 года назад

    From where can I find the practice examples?

  • @KaranSingh-uj4jh
    @KaranSingh-uj4jh 4 года назад

    really helpful

  • @sumesht.a8528
    @sumesht.a8528 7 лет назад

    Great lecture

  • @robindong3802
    @robindong3802 7 лет назад

    greate demo. thanks

  • @al-girvantobias8462
    @al-girvantobias8462 7 лет назад

    Can numpy be used on FASTA files to create arrays?

  • @kostasnikoloutsos5172
    @kostasnikoloutsos5172 7 лет назад +2

    I think for better understanding we have to study numpy with pandas.
    Just because there are a lot of things that are the same.

  • @shrutijain1628
    @shrutijain1628 4 года назад

    💯💯

  • @MrPrudhvisai
    @MrPrudhvisai 4 года назад

    can we add two arrays with different shapes ?

  • @sonamnaik2804
    @sonamnaik2804 5 лет назад

    thank u💙

  • @mounabarhoumi7584
    @mounabarhoumi7584 6 лет назад

    how can we segment an image(or a matrix) into sub-images (in square form), and thanks for helping me

  • @RishiKumar-ql5zh
    @RishiKumar-ql5zh 10 месяцев назад

    I think a seven year old playlist is a bit bit old...........
    my vscode says np is no longer a keyword.
    please update it

  • @paragjp
    @paragjp 6 лет назад

    Hi, I have a query, i am having following code a=np.array([1,2,3,4])
    t=np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]])
    print(a)
    print(t)
    a.itemsize
    a.ndim When it runs in jupyter notebook it shows output of a.ndim only. Can you pl explain me why ? and Thanks for great simple to understand videos

    • @paragjp
      @paragjp 6 лет назад +1

      Just to clarify : running above code into single cell, if running a.itemsize and a.ndim in different cells it is showing correct result

  • @levendeurdemeches6600
    @levendeurdemeches6600 6 лет назад

    Thank you a lot!

  • @paragjp
    @paragjp 6 лет назад

    Can you pl explain what is a difference between flatten and ravel ?

    • @kiyochi7705
      @kiyochi7705 3 года назад

      flatten always returns a copy. ravel returns a view of the original array whenever possible. This isn't visible in the printed output, but if you modify the array returned by ravel, it may modify the entries in the original array.
      Source: stackoverflow.com/questions/28930465/what-is-the-difference-between-flatten-and-ravel-functions-in-numpy

  • @mehandiyanaaditya
    @mehandiyanaaditya Год назад

    thanks sir

  • @shankargudala1418
    @shankargudala1418 3 года назад

    Sir where is the part two of this video

  • @civilengineeringandprogram1466
    @civilengineeringandprogram1466 5 лет назад

    sir how to extract rows and columns

    • @codebasics
      @codebasics  5 лет назад +3

      lets say you have 2D array,
      a = np.array([[1, 2, 3],
      [4, 5, 6],
      [7, 8, 9]])
      To access column # 1 you can do a[:,1] this gives [2,5,8]
      To access row #2 you can do a[2, :]

    • @civilengineeringandprogram1466
      @civilengineeringandprogram1466 5 лет назад

      @@codebasics thank u sir. How to read text files and extracts it's columns ..

  • @samrozch8419
    @samrozch8419 Год назад

    nice

  • @sukanyachoudhury6174
    @sukanyachoudhury6174 2 года назад

    Hello sir, I went through this tutorial and I was trying some exercises. I have a question.
    I have a 3 dimensional array defined as below:
    a3 = np.array([
    [[1, 2, 3],
    [4, 5, 6],
    [7, 8, 9],
    [20, 21, 22]],
    [[10, 12, 13],
    [14, 15, 16],
    [17, 18, 19],
    [7, 8, 9]]
    ])
    now, when i do a3.sum(axis =0) it does a row wise addition of the above structures and returns array([[11, 14, 16],
    [18, 20, 22],
    [24, 26, 28],
    [27, 29, 31]])
    and when i do a3.sum(axis =1) it does a column wise addition and returns :
    array([[32, 36, 40],
    [48, 53, 57]])
    While for a 2 dimensional array it does the opposite i.e. column wise addition for axis =0 and row wise for axis =1.
    Can you please tell me why is it so? is the logic different for even and odd dimensional arrays?

  • @brotherlui5956
    @brotherlui5956 6 лет назад +1

    Pythons range(x) does not create a list/array cause it is a generator and cannot be compared with numpys arange() method which creates an array/list

  • @kanechulchulikpongse9549
    @kanechulchulikpongse9549 4 года назад

    great

  • @mohsinali_78
    @mohsinali_78 3 года назад

    Sir basically now translation of our voice is generating on youtube videos due to which we could not be able to see proper codes.If you have some solution for it kindly remove it from your coding videos.

  • @vamsisaggurthi5528
    @vamsisaggurthi5528 6 лет назад

    Good

  • @jeanrodrigues6249
    @jeanrodrigues6249 2 года назад

    Jason

  • @brotherlui5956
    @brotherlui5956 6 лет назад +1

    i hope you know by now that Numpy is spoken "num pie" and not "num pi y", it´s hard to take your course seriously because of this misspelling. carpe diem

  • @neerajsharma-js2we
    @neerajsharma-js2we 2 года назад

    I am confused here why array is taking so much space and so much time to process
    import numpy as np
    import time
    import sys
    SIZE = 1000
    # CODE FOR LIST
    l1 = range(SIZE)
    l2 = range(SIZE)
    start = time.time()
    result = ((x+y) for x, y in zip(l1, l2))
    print("SIZE of list is: ", sys.getsizeof(result))
    print("Time taken by list processing : ", (time.time()-start)*1000)
    # CODE FOR ARRAY
    a1 = np.arange(SIZE)
    a2 = np.arange(SIZE)
    start = time.time()
    result = a1 + a2
    print("Time Taken by array processing : ", (time.time()-start)*1000)
    print("SIZE of array is: ", sys.getsizeof(result))
    Results:
    SIZE of list is: 112
    Time taken by list processing : 0.028133392333984375
    SIZE of array is: 8112
    Time Taken by array processing : 0.030040740966796875