Python Data Structures: Sets, Frozensets, and Multisets (Bags)

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ม.ค. 2025

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

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

    This is channel is really great 👍

  • @deusvult4678
    @deusvult4678 4 ปีที่แล้ว +1

    Your tutorials are really like the channel s name .. this one is real python

  • @sto3359
    @sto3359 7 ปีที่แล้ว +5

    Thanks Dan, I recently learnt about this from the docs. Great explanation.

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

    Excellent video.

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

    Isnt the Counter class really a dictionary with a custom add item protocol defined? (Newb question sorry if its not accurate).. it kind of is right? I forgot multisets exist...

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

    Thanks again. I didn't know about Counters or frozen sets. Really useful stuff! Would be cool to see you making small rpg type game with all these neat Python tricks. I would enjoy watching like a 1 hour video of it.

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

    Wonderful explanation but add time stamps for targeted navigation for viewers

  • @bronodude
    @bronodude 7 ปีที่แล้ว +4

    You hve not added link to 'what is hashable' that ccanbe added to sets.. Also can you state what is data structure in simple terms?

  • @everythingcelebrity6296
    @everythingcelebrity6296 4 ปีที่แล้ว +1

    Dude which ide are you using?

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

    Is there a compelling reason to use a Counter over a vanilla dictionary other than convenience/syntactical sugar? That .update() function is pretty slick

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

    Is a frozenset the same as a tuple?

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

    As a general question. What would be the pythonic way to express the following:
    journal_data.append(user_input(cmd))
    or...
    journal_entry = user_input(cmd)
    journal_data.append(journal_entry)

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

      There's no pythonic way in this but just a design preference.
      What I would suggest is go for second way as it looks much cleaner that way and you can use that variable at multiple places without repeating your code again and again.

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

    Quick question: Isn't Multi-Bags example a 'dict' type, and not 'set()' ?

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

    great video

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

    what font is this?

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

    Hey Dan!
    Is there a way to have lists on a set besides getting a tuple version of those lists and append it to the set?

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

    Is this IDLE or something else? Because I love its theme!

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

      Dan Bader 😭😭 I'm on Windows

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

    Well I used to call Counter or multiset a freq_dist

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

    Is this how websites store user accounts? Seems like it can in a way.