numpy tutorial - introduction | numpy array vs python list

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ธ.ค. 2024

ความคิดเห็น • 106

  • @codebasics
    @codebasics  2 ปีที่แล้ว +4

    Do you want to learn technology from me? Check codebasics.io/ for my affordable video courses.

  • @mehdimemar
    @mehdimemar 6 ปีที่แล้ว +1

    I do'NT understand who would dislike this video?!? His videos are short and informative, with clear explanations and exact titles. what are you looking for??! GOOD LUCK TO @codebasics

    • @TotluTV
      @TotluTV 5 หลายเดือนก่อน

      No one has disliked actually :)

  • @AetosAnatole-tm6xz
    @AetosAnatole-tm6xz 8 ปีที่แล้ว

    Thank you... For the best introduction to numpy.....
    Hope u teach us more abt numpy in upcomng tutorials......

  • @Actanonverba01
    @Actanonverba01 7 ปีที่แล้ว +47

    Good video, by the way, many people in Europe and NA say 'num-PIE' ☺

  • @codebasics
    @codebasics  5 ปีที่แล้ว

    Step by step roadmap to learn data science in 6 months: th-cam.com/video/H4YcqULY1-Q/w-d-xo.html
    Learn data science with pandas: th-cam.com/video/CmorAWRsCAw/w-d-xo.html
    Machine learning tutorials with exercises:
    th-cam.com/video/gmvvaobm7eQ/w-d-xo.html

  • @shubham_birhade_vlogs
    @shubham_birhade_vlogs 3 ปีที่แล้ว +4

    Important interview question asked about numpy is which is fast among numpy or list? And why?
    And this is well explained in this video.
    Thanks for such amazing videos
    👍👍👍

  • @siddharthadebvines5296
    @siddharthadebvines5296 3 ปีที่แล้ว +1

    You are an Angel, Sir
    Love your content

    • @codebasics
      @codebasics  3 ปีที่แล้ว +1

      Glad it was helpful!

  • @yousafs9837
    @yousafs9837 8 ปีที่แล้ว +1

    best numpy intro ever! thanks!

  • @saritha3957
    @saritha3957 2 ปีที่แล้ว +5

    How is " L= range(1000)" making a list ?

  • @UnixMan100
    @UnixMan100 7 ปีที่แล้ว +3

    Great video and explanation!
    One question -> I installed numpy under a 64bit architecture. I noticed that python list took less time than my numpy results. Is this just due the larger byte sizes I have in 64bit ?
    Result below: Where I made SIZE = 1000000
    python list took: 0.008821487426757812
    numpy took: 2.1543502807617188

    • @UnixMan100
      @UnixMan100 7 ปีที่แล้ว +3

      Ah nevermind had a small typo in my result = [(x+y) for x, y in zip(l1,l2)] line of code lol.
      Results make more sense now
      python list took: 101.22132301330566
      numpy took: 11.317014694213867

  • @nischalshakya2015
    @nischalshakya2015 3 ปีที่แล้ว +6

    I think the size of one element of the NumPy array is not always 4 bytes. It depends on whether your machine is 32 bit or 64 bit.

    • @anshpatel8083
      @anshpatel8083 2 ปีที่แล้ว

      if 64 bit, then maybe 4 bytes would be 8 bytes but I think half the word would be unused.

  • @muthulokesh9444
    @muthulokesh9444 3 ปีที่แล้ว

    Clearly explained- Thaks!

  • @riseabovehate9476
    @riseabovehate9476 6 ปีที่แล้ว +1

    6:41 what does zip mean ? Pls provide explanations for each and everything you write.

    • @narutokunn
      @narutokunn 6 ปีที่แล้ว

      It is used to loop over 2 collection.

  • @robindong3802
    @robindong3802 7 ปีที่แล้ว +1

    Nice and clear demo, thanks

  • @manishaarya247
    @manishaarya247 2 ปีที่แล้ว

    If error come attributes not found or array not defined something. .... Then go to windows type numpy.py then enter tha path file and then form there change to name of numpy to anything..like program,file,nummy. Anything you like. Then again run the same code

  • @FlashManinSpace
    @FlashManinSpace 7 ปีที่แล้ว

    You make the best intro videos ever!

  • @odarigeraldangule
    @odarigeraldangule 2 ปีที่แล้ว

    Straight to the point

  • @ruchk3872
    @ruchk3872 5 ปีที่แล้ว

    Thank you for explaining it so simple way.....

  • @luckybairagi7294
    @luckybairagi7294 5 ปีที่แล้ว +2

    Nice video... But how did you assigned list in integer??

  • @triparnakar5836
    @triparnakar5836 7 ปีที่แล้ว +3

    Question: when I do this sys.getsizeof([1]) in the python shell, it gives me 72, and when I do sys.getsizeof(np.array([1])) in the shell, it gives me 100.... so, by that logic, it seems the array object takes more space?? or am I missing something?

    • @triparnakar5836
      @triparnakar5836 7 ปีที่แล้ว +1

      codebasics but, here, for a single item, array object seems to have a bigger size (100), than that of list (72)

    • @riseabovehate9476
      @riseabovehate9476 6 ปีที่แล้ว +1

      @@triparnakar5836 When it comes to computational speed , only elemental attributes are to be considered. use array.nbytes to check how much memory the elements occupy. Getsizeof isn't the right method to check size of ndarray

  • @michaelmolter6180
    @michaelmolter6180 7 ปีที่แล้ว

    Interesting, I got a different result. Numpy took 22.5 ms and straight Python (3.6) took 0.5 ms for n = 1000.

  • @adilmajeed8439
    @adilmajeed8439 3 ปีที่แล้ว

    in your earlier 16 videos, you have mentioned about the list comprehensions and zip functions, why i am asking these questions because i am following what you had advised in your initial video and being me as a novice difficult to follow the instructions then

  • @sukanyak9975
    @sukanyak9975 หลายเดือนก่อน

    Good explanation

  • @carkibaatapkesath5323
    @carkibaatapkesath5323 2 ปีที่แล้ว

    Sir you are great 🙏🙏

  • @anharkarimmahyudin8108
    @anharkarimmahyudin8108 3 ปีที่แล้ว +2

    Hello sir, I've installed numpy in cmd and then I test running it in python idle and it's work, but why when I tried to run it in pycharm it's not work and always error. It's said that "no module named numpy" why ?

    • @kavishsanganeria2981
      @kavishsanganeria2981 3 ปีที่แล้ว

      u need to install the package on pycharm
      go to files>>settings>>choose your program>>pip>>search for numpy>>install packages

    • @anharkarimmahyudin8108
      @anharkarimmahyudin8108 3 ปีที่แล้ว +2

      @@kavishsanganeria2981 thanks, it was really help me

    • @areejbasudan4732
      @areejbasudan4732 2 ปีที่แล้ว

      @@anharkarimmahyudin8108 what was kavish's reply?

    • @anharkarimmahyudin8108
      @anharkarimmahyudin8108 2 ปีที่แล้ว

      @@areejbasudan4732 sorry, i forget what he said cuz he deleted his reply

  • @milan_shah
    @milan_shah 5 ปีที่แล้ว

    (I have Python 3.5.2 installed in Ubuntu 16.04.5)
    For the above code, why I'm getting the following output rather than (14000 & 4000):
    24000
    8000

    • @murifedontrun3363
      @murifedontrun3363 5 ปีที่แล้ว +1

      Byte size of elements varies with Operating system

  • @Quest_adventure
    @Quest_adventure 2 ปีที่แล้ว

    Hi, can anyone explain while trying to install via terminal the message shows like that- "Defaulting to user installation because normal site-packages is not writeable". Thanks

  • @illeyunzaman5329
    @illeyunzaman5329 ปีที่แล้ว

    code basics you created the range again and again in the code using range function and you call it list although list is created with [ ] and elements are separated by commas please explain this

  • @goodester6924
    @goodester6924 6 ปีที่แล้ว +1

    great tutorial!

  • @surajmondal5278
    @surajmondal5278 4 ปีที่แล้ว

    What is the reason of putting 5 in braces for sys.getsizeof() for list only?
    For array why you did not use same thing?

  • @andreacazzaniga8488
    @andreacazzaniga8488 7 ปีที่แล้ว

    well done, brief and spotted to the point!

  • @nupoorsolanki8526
    @nupoorsolanki8526 6 ปีที่แล้ว

    error importing mysqldb....m using python 3.7..module working in cmd prompt but not in jupytor notebook..i have tried all possible like MySqldb..........sql.connector..all experts are failed to help me..can u solve. im tryong to connect with mysql database using python..
    success to installing..but failed to import in jupytor anaconda..

  • @ramanjaneyulu476
    @ramanjaneyulu476 6 ปีที่แล้ว

    Hi,hello all, I have one csv file and one xlsx file..
    My requirement is I want to read the data of particular row and column from csv file
    And that data need to write in particular row and column to an xlsx file.....Any suggestions would be appreciated

  • @satyanarayanpardhi5314
    @satyanarayanpardhi5314 6 ปีที่แล้ว

    Great series....

  • @satyenmehta9749
    @satyenmehta9749 4 ปีที่แล้ว

    why do i get print(sys.getsizeof(5)) - 28 ??

  • @tahaanwar5224
    @tahaanwar5224 6 ปีที่แล้ว

    great videos man.....just i suggestion its pronounced as "num + pie" = numpy although numpiY is catchy

  • @sushantregmi2126
    @sushantregmi2126 5 ปีที่แล้ว

    Quality content

  • @candicardo6647
    @candicardo6647 7 ปีที่แล้ว

    good introduction. Thanks!

  • @rohitgandhi4991
    @rohitgandhi4991 11 หลายเดือนก่อน

    Please tell the order in which we need to study python from your channel

  • @surajpanigrahi4275
    @surajpanigrahi4275 ปีที่แล้ว

    Sir, I am new to numpy just finished my Python, and came here to learn numpy.
    But sir from this video i'm not able to learn because you have maked this for working professionals not for begineers.

  • @CryptoRootz
    @CryptoRootz 6 ปีที่แล้ว

    Dope! Thanks for making things clear

  • @sonamchoudhary5918
    @sonamchoudhary5918 6 ปีที่แล้ว

    Hi. I will soontbstart data analyst tutorial on udecity. They want numpy as prerequisite. Will these 4 tutorial be sufficient to start the course ??

  • @brijesh0808
    @brijesh0808 4 ปีที่แล้ว

    In my comp the size diff is 28vs8 instead of 14vs4. Is this because of 32bit and 64bit sys?

    • @yaksh994
      @yaksh994 10 หลายเดือนก่อน

      yes, when running Python code in PyCharm, it typically uses the Python interpreter installed on your system. So, if you're running your Python code within PyCharm on a 32-bit system, integers will likely default to 4 bytes. On a 64-bit system, integers will typically default to 8 bytes.

  • @kevinsaify8270
    @kevinsaify8270 3 ปีที่แล้ว

    Can you please make a full data science course according to sequence???

    • @codebasics
      @codebasics  3 ปีที่แล้ว

      On TH-cam search for "codebasics data science", you will find my videos please watch it

  • @raunakgiri21
    @raunakgiri21 2 ปีที่แล้ว

    Hey! I tried traversing through both python list and numpy array using for loop and i found a surprising result!
    Numpy array took more time than Array list !!!
    Can anyone explain why?

  • @mimrankhan9974
    @mimrankhan9974 7 ปีที่แล้ว +3

    plz sie upload videos on scipy and scikitlearn

    • @mimrankhan9974
      @mimrankhan9974 7 ปีที่แล้ว

      ok thanx and os module as well and also tell us which type of project we can make on python im beginer i dont have any idea

  • @looper6394
    @looper6394 7 ปีที่แล้ว

    hi, i dont have mingw on my computer, how do i use " $ pip install numpy " in this case?

    • @looper6394
      @looper6394 7 ปีที่แล้ว

      thanks for you reply, im not very familiar with the command prompt. to make this work, i had to drop the $-sign and just type "pip install numpy"

  • @yilmazbingol6953
    @yilmazbingol6953 6 ปีที่แล้ว

    pip install numpy
    ^
    SyntaxError: invalid syntax can anyone help pls

  • @sanketshirke185
    @sanketshirke185 6 ปีที่แล้ว

    kya ye complet tutorial he numpy ka? can u uplode veidos on matrix in numpy

  • @shritamkumarmund5273
    @shritamkumarmund5273 6 ปีที่แล้ว

    Every time when I run this code in Jupyter Notebook. I am getting 28.
    #My Code
    import sys
    sys.getsizeof(6)
    Output: 28
    How it's possible? Each object size has 14 bytes, and here i am getting 28.
    Can you please tell me how to fix it or whats wrong in it.

    • @imranm6196
      @imranm6196 3 ปีที่แล้ว

      Did you figure it out yet ? I have same problem, plz lemme knkow. thanks.

  • @rishikeshagrawani7920
    @rishikeshagrawani7920 7 ปีที่แล้ว

    Nice video.

  • @nikitasinha8181
    @nikitasinha8181 2 ปีที่แล้ว

    Thank you sir

  • @girijeshjha
    @girijeshjha 7 ปีที่แล้ว

    What if I write:
    print(sys.getsizeof(1000)*len(array))

  • @vamsisaggurthi5528
    @vamsisaggurthi5528 6 ปีที่แล้ว

    Awesome

  • @chrisvanmaarseveen5049
    @chrisvanmaarseveen5049 7 ปีที่แล้ว

    is numpy only for python 2.7 or also for python 3.5?

  • @flamboyantperson5936
    @flamboyantperson5936 6 ปีที่แล้ว

    Nice video. I just would like to know are these 4 videos enough for numpy? because I want a job in Python so I have to learn in deep. Thank you.

    • @flamboyantperson5936
      @flamboyantperson5936 6 ปีที่แล้ว +1

      Thank you so much for taking out time and replying. I see your videos daily after reaching home from work. Your videos are awesome.

  • @meghnasingh9941
    @meghnasingh9941 4 ปีที่แล้ว

    why only my numpy array taking more time than python list, rest everything is same

  • @miladsayad2935
    @miladsayad2935 6 ปีที่แล้ว

    a = np.arange(1000).
    print (a.itemsize * a.size)
    I get 8000. (8 bites) can you please explain this?

    • @chitwanjain3062
      @chitwanjain3062 6 ปีที่แล้ว

      @@codebasics I've a 64 bit m/c. It is showing 4 bytes as size of numpy array & 28 bytes as size of python list object. can u plz explain why so ?

  • @sleepyvoice581
    @sleepyvoice581 6 ปีที่แล้ว +4

    you have to correct your spelling it's convenient not convinient....

    • @kranefivem
      @kranefivem 6 ปีที่แล้ว +2

      SleepyVoice NOBODY CARES DUDE

    • @RyanJensenEE
      @RyanJensenEE 5 ปีที่แล้ว +1

      Your comment is a run-on sentence. There should be a period or a semicolon after your use of the the world "spelling".

  • @sivabharathis6545
    @sivabharathis6545 9 หลายเดือนก่อน +1

    john mass

  • @manishaarya247
    @manishaarya247 2 ปีที่แล้ว

    Problem ....
    .Load attributes is not defined

  • @urduwithbilalhashmi
    @urduwithbilalhashmi 2 ปีที่แล้ว

    Sir! I am a real fan of you but I feel that being a super expert you sometimes can't come down to a beginner's level to consider his/her issues. In the starting of Numpy who can understand where and how to get pip installed.

  • @hariharamoorthythennetipan2190
    @hariharamoorthythennetipan2190 7 ปีที่แล้ว

    nice viedo

  • @Hany_AlShahhat
    @Hany_AlShahhat 5 ปีที่แล้ว

    thanks

  • @mayurbhor2231
    @mayurbhor2231 4 ปีที่แล้ว

    Ok , Why does python lists exist then ?

  • @im_karamo1907
    @im_karamo1907 6 ปีที่แล้ว

    In case you have your dataset and you wants to import it via pandas or numpy using import function, do you need to save your data into numpy library or? If yes how do you do this?
    I have a dataset from internet Im trying to practice to manipulate the data using numpy import function, but it tells me file error. Im suggesting that maybe i need to save the file in the desktop and if i go to python and use import function it doesn't work.. Please i need explanation how to solve this...
    You may reach me via email kamasbah@gmail.com
    Your aid is highly needed thank you.
    Im thinking how do i need to save the file for it to be recognise as by numpy import function.

  • @rajanmishra7733
    @rajanmishra7733 2 ปีที่แล้ว

    Int object is not Iterable

  • @poshhakhbyaakansha2890
    @poshhakhbyaakansha2890 3 ปีที่แล้ว

    U r good. Just one advice. Don't concentrate on your pronunciation. Speak the way you do. English is just a language...like any other language. We don't really have to overdo it.

  • @mohammedshahad4237
    @mohammedshahad4237 2 หลายเดือนก่อน

    Sir It Is Not Clear

  • @mehreenkhan4917
    @mehreenkhan4917 6 ปีที่แล้ว

    U have a kashmiri accent..... Anyways good tutorial

  • @geekyprogrammer4831
    @geekyprogrammer4831 6 ปีที่แล้ว

    what is num PUY?

  • @starship1701
    @starship1701 2 ปีที่แล้ว

    Your keyboard is so loud

  • @Shakalal69
    @Shakalal69 4 ปีที่แล้ว

    I dont know anything about coding and all

    • @codebasics
      @codebasics  4 ปีที่แล้ว

      No issues. Just start with my python. Tutorials playlist. It is designed for beginners just like you

  • @sahilmehra290
    @sahilmehra290 ปีที่แล้ว

    Idk watching your video seems like just looking someone who knows how to code nothing else .

  • @khizarstudy2095
    @khizarstudy2095 2 ปีที่แล้ว

    No jupyter notebook in this 🥲