Python: Lambda, Map, Filter, Reduce Functions

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

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

  • @yongkyosunim
    @yongkyosunim 5 лет назад +18

    Finally, someone who actually explained this quite elegantly and simply.

  • @ashfaqtunio1311
    @ashfaqtunio1311 8 лет назад +95

    This is great. I always found these functions confusing, but you have explained them so clearly, I am going to use them extensively in my coding. Thanks a lot.

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

      bhali karay ayo

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

      same, great video!

  • @jorgeespinoza3938
    @jorgeespinoza3938 4 года назад +4

    I"ve seen many videos about this topic, but this is, BY FAR, the BEST. Not only the pace was the adecuate fir beginners like me, but it was also full of examples and alternatives. Thanks for publishing this video. Thumbs up thumbs ☝!!

  • @mulengamulenga5449
    @mulengamulenga5449 Год назад +2

    Wow ... that's so simplified!!! I finally got someone who me me see all of them at once in a simplified manner along with how they can be used together. Thanx Joe!!!

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

      You're so welcome!

  • @tecolote8566
    @tecolote8566 8 месяцев назад +2

    EXCELENTE: GOOD EXPLANATION. BETTER THAN MY TEACHER, AT COLLEGE.

  • @Armadurapersonal
    @Armadurapersonal Год назад +3

    I have an interview coming and needed a refresher. Thank you.

  • @prasadfalke376
    @prasadfalke376 4 года назад +5

    Joe, you just helped me understand Lambda and other functions. This will be the easiest explanation I have seen so far. (a week into Python programming)

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

    I took this lesson in a paid online course and didn't make any sense. I watched this video and it's crystal clear now.
    Thank you Sir!

  • @meebsrashid4090
    @meebsrashid4090 3 года назад +3

    this is easiest way to teach complex method...Thank You!!!

  • @alexyuwen
    @alexyuwen 3 года назад +16

    Small mistake at 5:20, the map function would only work if square was defined as
    def square(num):
    return num**2
    since the parameter would need to be a number, not a list.

    • @onemanenclave
      @onemanenclave 2 года назад +3

      That approach was meant to be equivalent to the _whole_ thing on the right, not just to the lambda function ;)

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

      def square(lst1=[]):

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

      ​@@juliuskamara1348didn't work

  • @daniel_english4u
    @daniel_english4u 10 месяцев назад +1

    Very clear and precise explanation that anyone should be able understand.

  • @shiningcopper
    @shiningcopper 4 года назад +7

    so easy to follow, great job!
    for the last part: i think the code needs to be updated and import functools
    import functools
    print(functools.reduce(lambda x,y:x*y,n))

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

    Subbed. Don't know why RUclips hasn't brought me to your channel before. Your explanation helped me understand three functions (two of which I hadn't even heard of) that I didn't understand before. Thank you.

  • @rahulkmail
    @rahulkmail 4 года назад +6

    Simply awesome. The way it has been explained.

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

    Excellent; very helpful. Thank you so much.
    Finally, a presenter who doesn't start every sentence with "so" or "".

  • @newsbie-thekidsnewsstop1811
    @newsbie-thekidsnewsstop1811 5 лет назад +3

    One of the most effective lessons I have seen!

  • @mau_lopez
    @mau_lopez 6 лет назад +13

    At last, an excellent and concise explanation of this functions, loved this clip ! Thanks

  • @rmalshe
    @rmalshe 8 лет назад +1

    This extremely simple lesson can save one hundreds of lines of coding. Thanks for creating it!

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

      Is this actually useful? I feel like you could do the same, even faster and more optimized with a simple numpy package

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

    This is gold. I have been doing codewars tasks for a while now, painstainkingly writing each lines for conditions. I wiish I found this earlier!

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

    Great concise video, this was the first video that I found using python3

  • @upendrauppi5778
    @upendrauppi5778 7 лет назад +9

    lot of confusion regarding comprehensions,lambda,map functions~!today i got clarity !!thk u so much!!!

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

    Thanks for the video! I was confused on lambda and this video explained them really well.

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

    Thanks a lot from Brazil! I always found them very confusing, now I am happy with this learning experience!

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

    Thanks for clarifying these so eloquently. Loved it.

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

    Well explained! I started learning Python 4 days ago on Treehouse, but still, with this explanation I managed to make my first lambda functions work in one go.

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

    Very simplified explanation..highly useful..can't thank you enough..outstanding

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

    Explanation was outstanding....crisp, clean and clear... Watched some of the videos but i found them vague... Contented after watching this ...cheers ..and Yes...Subscribed 😊

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

    Neat and clear explanation with good example.

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

    Thanks for sharing Joe, very clear and didactics your explanation.

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

    Thank you for the explanation. Just a correction at 5:24 . You cannot pass the square function as-is to the map along with the list. The map is expecting individual items. Not the list itself.

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

    Very helpful sir. Hope a lot of students will learn something from it. Regards, love and affection.

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

    thank you, so clear. I love the visuals

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

    you have exaplained in simple english brother. thank you

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

    That is awesome. simple, neat visually presented.. easily understandable on comparing to traditional functions

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

    i watched alot of videos about that functions, i couldn't understand any one of them! except yours, it was awsome!

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

    At 5:00 you can’t use the square function with map there. Since map takes on element from the list a time, and then applies the square function to it, *but* the square function is written to deal with an entire list not a single element.

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

    Thanks a lot. I am a Java developer. I find this map, filter, reduce concept new. Learnt new thing today 😊😊

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

    Very clear. Thank you for taking the time to enlighten us.

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

    Word of correction about 3:10 you’re saying that map returns a list. This is not true, it returns an iterator which may or may not be converted into a list. This is why we use list(map(func, [])) to convert a map output to a list.

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

    helpful video, really explains the lambda concept

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

    Superb explanation Joe!! I have always confused with Map filter reduce and list comprehension concepts !!! I am very much clear now exactly when to use them.

  • @wingoedgy
    @wingoedgy 7 лет назад +14

    Your videos are outstanding.

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

      +Wingo Chambers thanks

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

    Thanks, u explained elegantly.

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

    The best Tutorial i have seen so far. well explained and i like the way u relate the subject with other similar operations.

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

    Thank you sir for your crystal clear explanation!!

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

    This is best video on RUclips,

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

    Simple and brief explanation! Thank you very much for your efforts!

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

    Very well explained. Thank you.

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

    Masha Allah. What a concise explanation. Thank you Brother. May peace be upon you.

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

    Explained in very easy way. Great video!!

  • @ivanfantang3591
    @ivanfantang3591 8 лет назад

    nice!, thank you so much, you have better lecture than my professor did!

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

    Definitely helpful vid, hate reading python docs

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

    Great video. Very simple and clear explanation. Thanks.

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

    well done man thanks for your clean and simple explanation

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

    so simple and clear, subscribed! Oh, you have a lot more videos!

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

      +photinoman I have about 90 videos. A third of them are on Python data structures and algorithms

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

    you use map function when you need to pass a function on variables, and use filter when you need to pass a condition on all elements and get the elements which hold true for it

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

    Very clear explanation thanks jay

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

    Great video, beautiful and clear explanation :-)

  • @cococnk388
    @cococnk388 Год назад +2

    Clear explanation

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

    Hi Joe, I am late to the party, but this is a very well made video. Super clear and helpful. Thanks.

  • @sm.future_pydev
    @sm.future_pydev 9 месяцев назад +1

    that helps so muchhhh!🥳 Thank You!❤

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

    This was very useful. Thank you

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

    Really clear explanation! Thank you so much!

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

    brief and clear !!! thanks

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

    Good one for beginners

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

    What is difference between map and lambda. Where can we exactly use all those map, lambda and filter. Great 👍 video

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

    Great Video! Any chance you'd be open to doing a comparison between Javascript and Python for shared functions (a compare and contrast?)

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

      Good idea. I do have a very similar video for Java on Streams processing. It’s my most popular video

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

    I like your tutorials ! cheers

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

    Thanks! That was simple to understand..

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

    Good Video with simple explanations... n=[10,100,1000,10000] print("Thank You {} Much". list(map(lambda x:(format(" very very ")**2, n))
    ))

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

    Great video

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

    You make it look easy, Thanks a lot!

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

    Just easy to ubderstand and really enjoyed. Thanks sir

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

    Excellent video! What I don't understand is how does the map and reduce function in python have anything to do with Hadoop's map and reduce? how are they related?

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

    Nice clear explanation - thanks

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

    Thank you sir for this video.Now I understand why they are called anonymous functions:)

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

    Thanks Joe. Can you upload video with more complex examples using lambda

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

    that was a real help joe

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

    Good work sir

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

    nums = [4, 3, 2, 1]
    def square(x):
    return x*x
    print([square(num) for num in nums])

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

      Short and easy one:
      nums = [4, 3, 2, 1]
      print([x * x for x in nums])

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

    Hi Joe, Thanks for the video. All the examples you have you given here from memory. My question: How we can work with a large CSV file?[File management ]

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

      Dang, I covered that in my Java Streams video, but not the Python one. Actually, I think I have two Python Map Reduce videos. There may be a link in comments. I don’t remember if I covered file IO in the other one. I also have a couple Python videos just on file IO, including CSV.

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

    there are syntax problems in the code shown 4:59. it should be print(square([4,3,2,1])). It should be print(map(square,n))

  • @JaydeepDe
    @JaydeepDe 8 лет назад

    short and sweet. thanks

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

    Excellent. !!!!!

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

    great video, thank you for this! But...
    why do we use these functions if we can just use list comprehensions??🤔🤨

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

    This is amazing

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

    Perfect explanation

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

    Woah, so simple! Thanks so much for the video, I think I understand now.

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

      your life is so simple!

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

    thank you Joey for this informative video!!

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

    awesome thanks for taking the effort to make this

  • @prafullsharma8029
    @prafullsharma8029 8 лет назад

    loved the video...very pellucidly explained...thanks....earlier i skipped the video coz of music :P

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

    Good explanations. Thanks.

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

    Thanks for this its fluently help me

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

    Nice explanation. Thanks

  • @awaraamin9670
    @awaraamin9670 8 лет назад +2

    an informative video! thank you

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

    Very well explained.

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

    tumbs up for the terminator style soundtrack .. .

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

    When you create a list comprehension or Lambda function does python assign a default variable name to the newly created list? The def function allows this.

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

    i love the intro music