Map, Filter, and Reduce Functions || Python Tutorial || Learn Python Programming

Поділитися
Вставка
  • Опубліковано 22 жов 2024

КОМЕНТАРІ • 574

  • @Socratica
    @Socratica  2 роки тому +7

    Wear a Socratica Python shirt for good luck coding: shop.socratica.com/products/python-by-socratica

  • @Socratica
    @Socratica  5 років тому +121

    It's official! The Socratica Python Kickstarter was a success! Thank you to all of our supporters. Because of you, many more Python videos coming soon!! 💜🦉

  • @Terniedintorni
    @Terniedintorni 5 років тому +42

    I am currently attending a university master in data science. These videos are 100 times Better than the slides I got from my professor. Clear and Easy to apply. Thank you

    • @anonymous-wd7pb
      @anonymous-wd7pb 2 роки тому

      Hi are u also learning machine learning...??

    • @mahdihabibi1875
      @mahdihabibi1875 3 місяці тому

      I am going to subscribe for this comment since I am starting my master's in Data Science in a week 😂😂 thanks BTW

  • @rweaver6
    @rweaver6 6 років тому +370

    Wonderful stuff. Sharp, professional and lively. The humorous delivery takes the edge off. At the same time, the presentation is carefully scripted to teach clearly and efficiently. No hesitations, no mistakes, no confusion. Just fast and pleasant learning. The code animation is easy on the eyes and so is she!

    • @alejorabirog1679
      @alejorabirog1679 5 років тому +6

      It's a master piece.

    • @Sra4825
      @Sra4825 5 років тому +45

      a masterpiece of a comment. clear and precise points. a subtle hint of hitting on the instructor.

    • @TheMangz1611
      @TheMangz1611 5 років тому +6

      @@Sra4825 she is worth it!

    • @kizzavincent
      @kizzavincent 3 роки тому +1

      You must be the best communicator of all time! Thanks.

  • @kailashprasad1137
    @kailashprasad1137 7 років тому +1264

    Python should be a comedian because it is full of one liners.

    • @abbysands9510
      @abbysands9510 7 років тому +2

      lol

    • @Chiramisudo
      @Chiramisudo 6 років тому +22

      A Map, a Filter, and a Reduce walk into a compiler... >.< Ugh! Obviously I should NOT be a comedian, lol.

    • @practicecomputing8506
      @practicecomputing8506 5 років тому +18

      1:40 "If brevity is the soul of wit, then python is in a class by itself"

    • @JoeWong81
      @JoeWong81 5 років тому +24

      The language itself was named after monty python

    • @salyoshkin
      @salyoshkin 5 років тому +4

      Still too long. What in python you write in 1 line, in R you do in couple of symbols

  • @juanmosca
    @juanmosca 6 років тому +162

    list comprehension is also a good option instead of map function:
    areas_lst = [ area(r) for r in radii ]
    also for filter:
    filtered_lst = [ d for d in data if d > avg ]

    • @xekis
      @xekis 6 років тому +18

      I was also going to comment that these functions are mostly deprecated because of list comprehension and generator expressions.

    • @normalmighty
      @normalmighty 5 років тому +17

      I was about to point out the same thing. You can much more cleanly combine both with an expresion like
      filtered_areas_list = [area(r) for r in radii if r > minimum ]
      and for the efficiency of an iterator, just swap the [] with () to make it a generator comprehension
      filtered_areas_iter =(area(r) for r in radii if r > minimum )
      list and generator comprehensions are also far more intuitive for anyone who encounters them in the wild without knowing about them beforehand

    • @obinator9065
      @obinator9065 5 років тому

      More readable!

    • @balavarikuti
      @balavarikuti 5 років тому

      And faster than map filter and reduce.

    • @Kachelator
      @Kachelator 4 роки тому

      same here

  • @rojanshrestha822
    @rojanshrestha822 4 роки тому +33

    if brevity is the soul of wit, then python is in a class by itself !! Wow

  • @eppotamus5255
    @eppotamus5255 7 років тому +12

    I have never seen tutorials this amazing. Its like I traveled back in time 30-40 years when people still made sense - could think and communicate. I enjoyed these so much. Thank you for all the hard work and long hours you guys put into this series. You are hands down the best! Can't wait to see the next one.

  • @ARJUN-op2dh
    @ARJUN-op2dh 6 років тому +53

    I generally don't comment but I am really amazed by this awesome video is. One word Awesome.... !! loved the way the concept was taught and delivered...

  • @pranjal86able
    @pranjal86able 7 років тому +461

    Loving the hate for Fahrenheit :) "How could this happen"

    • @jcxmej
      @jcxmej 7 років тому +1

      pranjal86able We do not know. 😂

    • @Psycho4Ever666
      @Psycho4Ever666 7 років тому +19

      Like my first Professor in electrical engineering, she always told us to keep to keep it clean and metric ^^

    • @aaronmaturanacandelas2370
      @aaronmaturanacandelas2370 6 років тому

      I was looking for this comment.

    • @divusiulius7539
      @divusiulius7539 6 років тому +2

      That's why your Elect Engineering teacher likes Peter the Meter Man!

    • @CuongNguyen-le5ic
      @CuongNguyen-le5ic 6 років тому +8

      Sigh, I wish US would use metric system, make life so much easier.

  • @myroncarvalho4872
    @myroncarvalho4872 5 років тому +19

    Moment I heard the last line. Paused. Liked. Subscribed. Turned on notification. Too good.

  • @instant_mint
    @instant_mint 7 років тому +81

    I can't stop thinking of GLaDOS while listening to this.

  • @stevejohnson1685
    @stevejohnson1685 6 років тому +6

    From a Haskell programmer: Great introduction! In addition, script provides a nice, subtle sense of humor. Ms. Castro has superb enunciation.

  • @hmak5423
    @hmak5423 4 роки тому +2

    At this very moment, you are the most engaging python teacher on UA-cam. Goes down mainly to the tone and style/theme and covering so much in one small video.

  • @019KADESH
    @019KADESH 4 роки тому +4

    You are in a class by yourself Socratica! The way you teach is simply superb!

  • @doviche
    @doviche 5 років тому +1

    Just started studying python a month ago, after almost 20 years of java programming language and I've just fallen in love with it.
    Great programming language.
    Very cool and attractive presentations Socratica.

  • @kennymccormic7578
    @kennymccormic7578 6 років тому +3

    This is by far the most clear explanation of filter/map/reduce! Thank you very much!

  • @AjaySharma-pg9cp
    @AjaySharma-pg9cp 3 роки тому +1

    Till now I haven't seen a video being posted like this, great with differences that making this playlist and channel different from others, keep it up

    • @Socratica
      @Socratica  3 роки тому

      Thank you for your kind and encouraging message!! 💜🦉

  • @whatyearisit9756
    @whatyearisit9756 5 років тому +17

    Why is Socratica so underrated. Why, oh why!?

  • @austinp.b6625
    @austinp.b6625 7 років тому +171

    hahaha this is good tutorial !!! Sounds like CIA briefing :P

  • @jeffm6651
    @jeffm6651 5 років тому +2

    This is by far the best explanation of map, filter & reduce in Python ever.

  • @ahmedscrazymixacm1167
    @ahmedscrazymixacm1167 3 роки тому +4

    You are great finally, someone teaches python with enthusiasm, instead of the sleepy attitude , BTW i really like the themes you use Great job

  • @jakobfredriksson2272
    @jakobfredriksson2272 4 роки тому

    Wow... Yesterday I found this channel and I can honestly write I've had difficulties with map, filter and reduce; especially knowing when to use them. EVERYTHING fell in place with this short video... amazing.

    • @Socratica
      @Socratica  4 роки тому +1

      This was so great to hear - thank you for telling us! It really helps us get motivated to make more videos! 💜🦉

    • @jakobfredriksson2272
      @jakobfredriksson2272 4 роки тому

      @@Socratica You are so welcome! I've watched some more videos this evening and you're making all subjects crystal clear in a very unique way. Keep up the good work! :)

  • @robinccc
    @robinccc 4 роки тому +1

    Didnt ever know that tutorials could be made this engaging. Brilliant.

  • @guilhermehx7159
    @guilhermehx7159 5 років тому +2

    These Python tutorials of Socratica are simply the best!!! 👏🏻👏🏻👏🏻

  • @АндрійКоваленко-и2й

    What a beauty... Programming languages always surprise me with its deep. Thank you for clear explanation!

  • @user-wc1sm8cj8s
    @user-wc1sm8cj8s 3 роки тому

    This is the only tutorial I've seen so far with this quality of editing, like, WHOAH!!!!

  • @emahbright8607
    @emahbright8607 4 роки тому +8

    this is the funniest python tutorial i've heard in a while....

  • @Socratica
    @Socratica  5 років тому +4

    We're halfway there. We still need your help! Support Socratica Python Kickstarter: bit.ly/PythonKickstarter

  • @pdubocho
    @pdubocho 6 років тому +6

    "How could this happen? I do not know"
    Easily my favorite video.

  • @jonathanmeyer4842
    @jonathanmeyer4842 6 років тому +1

    The "multiplier" lambda expression is already defined in Python -> "import operator as op"
    Therefore the reduce call is : "reduce(op.mul, data)"

  • @MK-lh3xd
    @MK-lh3xd 2 роки тому

    Socratica team is a unique blend of technology, teaching, wit and dialog delivery.

    • @Socratica
      @Socratica  2 роки тому

      These are a few of our favourite things!! 💜🦉

  • @Socratica
    @Socratica  4 роки тому +29

    Welcome to Socratica! You can see our entire Python Playlist here: bit.ly/PythonSocratica
    Subscribe to see all our new videos! bit.ly/SocraticaSubscribe

  • @cruepprich
    @cruepprich 6 років тому +2

    Best map,filter,reduce explanation i've seen for any language! Thx!

  • @indrajitbagchi7313
    @indrajitbagchi7313 7 років тому

    these are seriously underrated videos......one of the best python tutorials......very nice

  • @faisalee
    @faisalee Рік тому

    I am addicted to your channel. Such wonderful delivery and the humour is priceless 😊

  • @MrAlhanz
    @MrAlhanz Рік тому +1

    You deserve much more attention! Those video are clear, interesting and have a great knowledge transfer.

  • @kdub1242
    @kdub1242 4 роки тому +1

    This stuff is great. Before going for the heavy artillery, it's also useful to first consider list/dict comprehensions, but map,filter,reduce are great tools for the toolbox.

  • @Jenko022
    @Jenko022 7 років тому +3

    I have been practising Python three for a while now but what I would really like to see is some videos on project ideas or scenarios to build on using Python. This would be great from practice and learning.

  • @humanrightsadvocate
    @humanrightsadvocate Рік тому

    It took me 12 years to find this channel. The algorithm never recommended me this channel. I stumbled upon this channel by entering, filter map lazy, in the search bar. Because... I was doing some exercises with map() and filter() and noticed the following code had unexpected results:
    num_list_4 = [2, 3, 6, 8, 9, 12, 15, 17]
    threevens = filter(lambda x : not x%3, num_list_4)
    sqrs = map(lambda x : x*x, threevens)
    print(num_list_4)
    #print(list(threevens))
    print(list(sqrs))
    The commented out line causes the sqrs list to be empty. And that's why I'm here.

  • @awisecar9540
    @awisecar9540 5 місяців тому

    Love the Halo/Matrix-esque aesthetic of this channel 🖤

  • @nikhilkash92
    @nikhilkash92 3 роки тому

    Your presentation is just out of this world.

  • @hashroot391
    @hashroot391 6 років тому +4

    First video I've ever watched on this channel. Kinda spooky but very engaging.

  • @lost-prototype
    @lost-prototype Рік тому

    I love the Command and Conquer / Westwood Studios vibe of these videos. I love post apocalyptic learning.

  • @jeffbarrett3344
    @jeffbarrett3344 4 роки тому

    Extremely well done series. The best way to learn in my opinion. Short, to the point, engaging, code examples and awesome jokes. Using a one-liner one-liner joke... beautiful!

  • @GEScott71
    @GEScott71 6 років тому

    Wow I'm loving Python and Socratica more and more with each video - thanks Socratica!

  • @gerardgauthier4876
    @gerardgauthier4876 4 роки тому

    Wow! I can't believe you are dis'ing the reduce function. The reduce function is the general form for more specific functional ideas.. A solid understanding of reduce is essential for any modern programmer.

    • @asero82.
      @asero82. 4 роки тому

      > Beautiful is better than ugly [...]
      python -c 'import this'

  • @jasonavina8135
    @jasonavina8135 2 роки тому

    These videos are evidence that anything can be explained in a clear, concise and easy to understand way. It really shows how silly knowledge gatekeeping is at the university and institutional level.

  • @henryyao4860
    @henryyao4860 4 роки тому

    This is the most entertaining python tutorial I have seen lol, but at the same time, I got what I need. Thank you!

  • @avinash1904931
    @avinash1904931 5 років тому

    Awesome. I was learning at Coursera applied data science with python. And had doubts in maps and lambda. Came across your video. Very creative and also very nice explanation with real life example. Excellent. Please make more playlists. Thank you so much

  • @RobertoMartinez-pz7im
    @RobertoMartinez-pz7im 2 роки тому +1

    Thanks so much for this video!

  • @rohitchakravarthi94
    @rohitchakravarthi94 2 роки тому

    If brevity is the soul of wit then python is a class by itself.
    "Wow", this channel needs to be praised for its intellectual content.

  • @stanislavhrytsyshyn1732
    @stanislavhrytsyshyn1732 5 років тому +3

    Watching ur videos brings a lot of pleasure and understanding of some moments, thx for ur work!

  • @nkoroieric
    @nkoroieric 7 років тому

    your illustrations always hit the nail on the head.

  • @karannagpal6390
    @karannagpal6390 6 років тому +4

    Just so people know, this is in python 3.
    In python 2.7, map returns a list itself and not a generator so there is no need to do list(map(fn, list_of_ele)) rather map(fn, list_of_ele) returns the final list.

    • @Nozomu564
      @Nozomu564 5 років тому +1

      [fn(el) for el in list_of_ele]
      There's no reason to ever use map in 2.7

    • @rednafi
      @rednafi 5 років тому +2

      And people who still use python 2.7 should go back to Jurassic age.

  • @bicycleninja1685
    @bicycleninja1685 5 років тому

    Awesome. The reduce example also works with text. ",".join(mylist) is commonly used, but reduce gives you more flexibility and in my opinion is more elegant, especially if you're combining multiple operations/functions.

  • @poyrazaktas6374
    @poyrazaktas6374 3 роки тому

    I've just explored this channel and I loved it!

  • @Leonardo-jv1ls
    @Leonardo-jv1ls 5 років тому

    I loved the explanation. Thank you. But if is was there in person watching, i would NEVER, raise my hand if had some doubt. This woman talking give me chills.

  • @TheWyrdSmythe
    @TheWyrdSmythe 3 роки тому

    Python ain’t the only comedian on this channel! 😉 I do love map and filter, but after they took reduce away I found myself leaning more towards just using list comprehensions. I usually want a list anyway. I do agree with the philosophy of providing a single way to do something, and map and filter are extra viewed that way.

  • @daslolo
    @daslolo 5 років тому +7

    "Python should be a comedian because it's full of one liners" - subscribed

  • @PerpetuaICreativity
    @PerpetuaICreativity 3 роки тому

    This is a python masterclass...even the jokes are efficient. great job and more please!

  • @DevinderKumar
    @DevinderKumar 3 роки тому

    Very crisp, clear and efficient !

  • @aykutdizdar
    @aykutdizdar 6 років тому +2

    I very much love the correct plural usage form of radius :)

  • @jimparsons6803
    @jimparsons6803 Рік тому

    Liked the clip. 'Friend Face.' Instructive as always with useful and practical information and approaches.

  • @Sjutturaah
    @Sjutturaah 5 років тому

    Ok. You just got a sub. These are hilarious while at the same time quite informational and compact. Well done.

  • @ishanktyagi3220
    @ishanktyagi3220 4 роки тому

    Thats amazing fully qualitative stuff with both professional and some humor thanks for the content

  • @a7madx7
    @a7madx7 3 роки тому

    I kinda like your approach very much, must've been so much effort put in this.

  • @ai.simplified..
    @ai.simplified.. 3 роки тому

    List is a python constructor
    List,earlier list.Append(list1 or lamba to earlier list)
    Map to reduced list

  • @raphasage
    @raphasage 2 роки тому

    A keen sence of dread lurking around you... ...must complete the class, for your own survival!
    Love the approach! Inta Sub!

  • @austinp.b6625
    @austinp.b6625 7 років тому

    So reduce take two inputs at a time .. like the fibinocci and map just one input. Good one. Thanks a lot

  • @jakeambrose4294
    @jakeambrose4294 2 роки тому

    Your course is awesome! Thank you. Im going through sololearns python courses and for each section, whatever the subject is, i come to your vids for further thorough explanation of whats being taught. I Appreciate your efforts more than words can express.

  • @MyLinuxToyBox
    @MyLinuxToyBox 5 років тому +2

    I love the voice and speaking rhythm. Very informative videos.

  • @eduard289
    @eduard289 2 роки тому +1

    Very good EXPLANATION

  • @sandeepnalvaya7612
    @sandeepnalvaya7612 4 роки тому

    After watching this, I want to buy a projector first, and tune in on this channel from video 1. Great work👍

  • @natalieastafeva4885
    @natalieastafeva4885 3 роки тому

    You made python sound like a detective story,very entertaining and useful!

  • @greyhnd001
    @greyhnd001 4 роки тому

    Awesome scripts. I am seeing this usefull for converting ips to binary and build a subnet calculator to confirm our firewall configurations are correct. Thank you so much for the work you've done on this.

  • @samuelfrank9947
    @samuelfrank9947 4 роки тому

    Nice innovative idea than other tutorials to explain.... Loved it

  • @diy-projects
    @diy-projects 5 років тому

    personally I absolutely hate the whole 'outer space' theme BuT there is the best available information available on this channel which makes it one of the best out there so thank you. much appreciated!

  • @mohammadsharif9192
    @mohammadsharif9192 5 років тому +11

    "we live to serve the user"
    in all my life I've never felt like the disposable tool I'm feeling right now .-.

  • @pruthvip8137
    @pruthvip8137 3 роки тому

    A unique style of python concept explanation , very different from other python learning UA-cam videos . Nice :)

  • @DUANEYAISER
    @DUANEYAISER 7 років тому

    Thank you for another great lesson! I've been using mapping lately and I love the way you explain it.

  • @revdevstudios
    @revdevstudios 6 років тому +1

    For those of you like me on Python 2.7, make sure to convert the (9/5) into a float before computing, or you'll end up having it evaluate to 1. You can just replace the 9/5 with a 1.8 or do something like (9.0/5)!

  • @shortcutDJ
    @shortcutDJ 7 років тому +20

    Hey Socratica and Guido (if you see this) Beer is on me!

  • @PunmasterSTP
    @PunmasterSTP 3 роки тому

    Another phenomenal Python video from Socratica. This one was particularly...filter-ific!

  • @Tweston3ny
    @Tweston3ny 2 роки тому

    Fantastic, per usual. Thank you. Awesome presentations with flawless, logical, and efficient, instruction and code.

  • @aghoorchian
    @aghoorchian 3 роки тому

    Captivating while teaching me what I needed to learn. Finally I know I'm gonna master Python soon!

  • @jamieg2427
    @jamieg2427 6 років тому

    I've never associated Python with cybernetic, ultra-furturistic aethstics and intense cybernetic humans yelling at me. Rather, it makes me think of confused baby pandas, pink waffles, and sunshine. The contrast is cracking me up. Subscribed~

  • @akira_asahi
    @akira_asahi 2 роки тому

    Thank you for the video. I am grateful for your time and contribution. Kind regards, Akira.

  • @Clarc115
    @Clarc115 6 років тому

    What a beautiful person who can communicate and instruct so masterfully.

  • @sparksays7247
    @sparksays7247 2 роки тому +1

    Great (and funny) vid👍🏾

  • @DaKLang
    @DaKLang 5 років тому +1

    Ok, that joke at the end had me laughing in public. Nice breakdown of those function, BTW.

  • @PKR1503
    @PKR1503 4 роки тому

    Your explanations are the best! Thanks for the help.

  • @bulentkamali
    @bulentkamali 5 років тому

    Very charming and delightful narrative

  • @leaoaugusto
    @leaoaugusto 3 роки тому

    "Python should be a comedian because it is full of one-liners." haha You got me there.!!

  • @GamingBlake2002
    @GamingBlake2002 4 роки тому +1

    Great tutorial, concise and simple

  • @mixbaal0
    @mixbaal0 4 роки тому

    Excelent video! I like the style and the presentation character too. And a tasty last line python joke. Congratulations. It would had been gorgeous to have a teacher like her in my college years. Hahahaha!!!

  • @hooshtube
    @hooshtube 7 років тому +4

    Please do a video on xml in python as well. These videos are priceless.

    • @skilz8098
      @skilz8098 5 років тому

      She compared xml to json in a previous video and basically said to hell with xml... for it's complexity....

  • @yousefhassan7365
    @yousefhassan7365 4 роки тому +1

    Thanks for whoever programmed you

  • @ivandrofly
    @ivandrofly 5 років тому

    3:09 - "Do not forgot your jacket if you are visiting Argentina" ahaha that was gold!

  • @Schlumpfpirat
    @Schlumpfpirat 4 роки тому

    Interesting approach style-wise. I like it.