Collections in Python - Advanced Python 06 - Programming Tutorial

Поделиться
HTML-код
  • Опубликовано: 29 янв 2025
  • Collections in Python - Advanced Python 06 - Programming Tutorial
    In this Python Advanced Tutorial, we will be learning about the collections module in Python. The collections module implements special container datatypes and provides alternatives with some additional functionality compared to the general built-in containers, like dict, list, or tuple.
    ~~~~~~~~~~~~~~ GREAT PLUGINS FOR YOUR CODE EDITOR ~~~~~~~~~~~~~~
    ✅ Write cleaner code with Sourcery: sourcery.ai/?u... *
    📚 Get my FREE NumPy Handbook:
    www.python-eng...
    📓 Notebooks available on Patreon:
    / patrickloeber
    ⭐ Join Our Discord : / discord
    We will be talking about 5 different types from the collections module: The Counter, the namedtuple, the OrderedDict, the defaultdict, and the deque.
    A written Tutorial can be found here:
    www.python-eng...
    You can find me here:
    Website: www.python-eng...
    Twitter: / patloeber
    GitHub: github.com/pat...
    #Python
    ----------------------------------------------------------------------------------------------------------
    This is a sponsored or an affiliate 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! 🙏

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

  • @saivamsi9859
    @saivamsi9859 3 года назад +19

    There are many demanding money for this detailed explanation and offering their paid courses,but you came out different and helping us.Thanks Buddy this means a lot ♥️♥️

  • @fuehnix
    @fuehnix 3 года назад +6

    the best crash course python tutorial series I've ever found

  • @xkinkachu23
    @xkinkachu23 4 года назад +12

    How are you not famous? This was so clear!

  • @gdthegreat
    @gdthegreat 2 года назад +6

    Man, your tutorials are nice and explaining good stuff in details with implementation, thanks for this.

  • @dabunnisher29
    @dabunnisher29 4 года назад +11

    I really like your tutorials. You do a very good job. Thank you for your efforts helping others like me.

    • @patloeber
      @patloeber  4 года назад +1

      Thanks for watching! I'm glad that you like it :)

  • @geekyprogrammer4831
    @geekyprogrammer4831 4 года назад +11

    This tutorial deserves more views! Great explaination buddy :)

    • @patloeber
      @patloeber  4 года назад +1

      Thanks :)

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

      i know it's quite off topic but does anyone know a good place to watch new series online?

  • @b.f.skinner4383
    @b.f.skinner4383 4 года назад +4

    Great summary of Collections, thank you

  • @PrithaMajumder
    @PrithaMajumder Месяц назад +1

    Thank You So Much for This Amazing Lecture 🥰
    Completed The Lecture Video - 6 on 1/12/2024 ✅

  • @ashwinip7756
    @ashwinip7756 4 года назад +1

    My Son Loved it Thank you

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

    Great tutorial! I wish the adds didn't pop up so often interrupting the video.

  • @icecreamman520
    @icecreamman520 2 года назад +1

    That is interesting. Can you use objects like tuples in counter? I think it would be more efficient to use a simple mean function or something, but might be helpful at some point to use counter with objects. 🤔

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

    well done !!

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

    The best video buddy.. :D.. You got a new subscriber

  • @fernandonakamuta1502
    @fernandonakamuta1502 4 года назад +1

    Very very useful :)

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

    Great tutorial, thanks mate!

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

    Thank you so much for your help

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

    EXCELLENT !!!

  • @drexesnn561
    @drexesnn561 4 года назад +3

    Myexpectationset = {"Great", "fast"," logical"," memorizable"} if Myexpectationset : print ("Yes") --->output ---> Yes

  • @abhishekkumarmishra9940
    @abhishekkumarmishra9940 5 лет назад +2

    Thanks

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

    Fantastic!

  • @shubhjangid7881
    @shubhjangid7881 4 года назад +1

    Hey Python Engineer Which add-ons you are using for python development for sublime...

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

      I'm using VS Code, Python Extension, pylint, and Code Runner Extension

  • @mohammadbilalniazi5987
    @mohammadbilalniazi5987 5 лет назад +2

    thanks sir

  • @brianbrian4899
    @brianbrian4899 4 года назад +1

    Best Regards

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

    Great tutorials, Of much help

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

      Thanks! Glad you like it

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

    thank you

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

    Amazing tutorial. Why was chainmap left out ?

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

    Great video

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

    I subscribed by the way

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

    Here one more subscriber !! Thanks to @Florin pop 🤚🏻

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

      Cool :) I’m happy that you found your way here!

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

      @@patloeber really excited to see more videos....hope vl go with some framework (flask or something else) too.....you have blessed with great voice.......cheers

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

    what IDE are you using. Looks like you are on a Mac. I like that output view window on the bottom.

    • @patloeber
      @patloeber  4 года назад +1

      VS Code on the Mac, but it's cross-platform. It has an integrated terminal which I use for the output window.

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

    Here is my suggestion to make this video more effective. Instead of deleting the lines, just comment them so that what you did is still there.

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

    How can we remove the keyword deque that is appearing while we print the object.

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

    Is there a reason to use list(.elements) method when one could just use list(a)? I am asking because you mentioned how tuple is more useful than list as in tuple being a lot faster than lists

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

      I'm not exactly sure what you mean? where in the video do i use list(elements)? with this syntax we simple create a list based on different elements. A tuple is not more useful in general. But it makes sense to use a tuple when you have a lot of elements and know that they are immutable. And yes then it has some performance advantages...

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

      I think he means
      "What's a point of doing
      list(my_counter.elements()) instead list(a)"

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

    I keep expecting you to start using redstone and pistons.

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

    defaultdict can i specifiy to return specific value?for instance d=55

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

      you can do it with a little trick: my_dict = defaultdict(lambda: 55)

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

    hacker examples for named tuple good

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

    Wheres chainmap?

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

    Thanks for the tutorial. What is the realtime implementation/use of namedTuple when we already have classes and objects ?

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

      Very good question! namedtuples are immutable, so you so would use them when you want the attributes stay fixed. Or when you don't need a full blown class but still want readable code. namedtuples are implemented a little bit more memory efficient than classes (because of this immutability). Moreover, namedtuples allow for more readable code, since the tuples are "self-documenting". sometimes it can also be better to use theme over a dictionary or normal tuple when you want to pass around immutable objects in your code.

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

      @@patloeberComprehensively answered. Thanks a million!!

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

      Comment on the las line 'somtimes it can aslo .... in your code'. aren't tuples immutable in the first place ? so why create a namedtuple if i am looking for immutability, and not a simple tuple ?

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

    Good video. However I am confused as to why you can pass the string 'x,y' when defining the namedtuple point and it recognizes it as 2 different attributes from the point class. Why does this work? Can you just list class attributes in a namedtuple like 'attr1,attr2,attr3' in the same string?
    EDIT: read the docs for nametuple which have this to say: "Alternatively, field_names can be a single string with each fieldname separated by whitespace and/or commas, for example 'x y' or 'x, y'." For those wondering the same.

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

    €500 , he has a lot of Indian colleagues.

  • @hogr_ider
    @hogr_ider 10 месяцев назад

    how to send you money

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

    please pronounce it as DQ

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

    Oh dear, the defaultdict is SO poorly explained....

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

    thanks