I usually don't comment much, but this is not just hilarious, but the pace, presentation style, lack of hipster fluff is impressive and refreshing! Nicely done!
Agreed, 30 sec in and I'm already laughing. Informative+funny is a very nice way to learn new information. Love the ominous background music too (I was waiting for a Guy Fawkes mask tho xD)
I strangely have an urge to listen and absorb the material in this video. I feel like this is a matter of life and death. And if I don't understand and use lambda function correctly, this world will end.
Well that was possibly the most entertaining Python video I've ever seen; it was a great explanation as well. This is the first Socratica video I've watched, but I'll definitely make a point to watch some more.
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!! 💜🦉
Thank you for this amazing job. Just some tips for the next serie... Most of the time, the most important line of code is at the very bottom of the videos. Thus, It is often hidden by the RU-vid player, or by the subtitles (if you activate it). A little bit upper would be perfect :)
We're glad you've found us! You can subscribe to Socratica here: bit.ly/SocraticaSubscribe To help us make videos faster, you can become our Patron! www.patreon.com/socratica
Welcome to Socratica! You can see our entire Python Playlist here: bit.ly/PythonSocratica Subscribe to see all our new videos! bit.ly/SocraticaSubscribe
Lambdas are fine but generally should be avoided. Why? By virtue of the fact that they're anonymous, code reuse is impaired, as is caching. I'm making an extreme case here, but lambdas should be thought of as a programmers convenience and not a prescribed way to code.
So ... what is the point of a Lamda? Seems like you can name it similar to a normal function, so why not simply use a normal function; or you just use it once in which case you don't need a function at all just use standard old inline procedural style code.
I would think its more concise than regular inline procedural style and doesn't unnecessarily pollute the namespace, if you really are just using it once. Imagine you have two sorting functions - one you only use once and the other all over your code. If you turn the first one into a lambda expression you can simplify the name of the other function (which makes the rest of your code more concise) because you don't have to be afraid of it colliding with your lambda expression.
i need help with something.How can i make this lamda to a normal no def function code lista =["Name1 10","Name2 5","Name3 8","Name4 9"] print(sorted(lista , key=lambda x:int(x.split()[1]),reverse=True)) what i have here is some names and im sorting from grade.Ive found this online but i just wanna make it simple
Have you seen to the point where she used a lambda in sort? These are the usual use cases for lambdas; where you need a function in an expression but don't need to define one. Storing it in a variable is just an added convenience that was used here to demonstrate that yes, this is indeed a function. See also map, filter, and reduce. Which heavily utilize lambdas. She also touched up a bit on higher order function (quadratic one in the video) which are functions that create functions. That's a delicious topic to learn and is super useful when solving problems. It's like a class template but for functions instead of objects.
Most of the lambda examples I've seen would be more readable with named functions (e.g. it would have been much better to name that "last name" function). The "function that builds functions" example was the first I've seen where lambdas actually make sense to use. Thanks.
Why can't we just not use the lambda function and write the code as it is without defining it as a function it should be fine too right? as we use function too help us define a block of code to be used multiple times but lambda functions are only used once. "So my question is why do we even need to define lambda function..?"
Thank you for your kind comment, Wing! We are a team here at Socratica (both men and women) and we achieve together! Just watched your wonderful channel trailer. I hope everyone watches it and is inspired: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-eX4VkEnpmUQ.html
Certainly! It just felt like women seem to be a bit underrepresented in this arena. I'm so flattered that you liked my video, there's lots to improve on, but your encouragement will motivate me to create more in the future. Thank you!!!!!
We totally hear you. We're baffled by the under-representation of women in STEM...the other side of the coin is that so far we don't have that many women watching our channel. Hopefully that is slowly changing. We need everybody's brainpower to have a bright future for the world! Keep us posted on how your work goes! :)
@ Wing N. It seems you have committed an error: Ulka is married. Don't give up hope. There may be single women teaching programming elsewhere. (HeeHeeHeeSnort)
@@mezigueescartefigue1254 Did you read Ulka's CV carefully? She's an actor AND a programmer. She has a degree in Computer Science from McGill University. She's also a choreographer and an incredible chef. We're lucky to work with such talented people!
A hot girl, is teaching me how to code in 2017, and i'm loving it. this is truly the nuts and bolts of the language, yay i'm just so excited and happy!
Very good presentation, but i do think lambda functions make your code less readable therefore i will not use them. Not trying to make the world better here, but you will receive flag from me whenever i read your code reading these type of functions. They are useless. You can do much better by just writing it out, and give the reader of your code a nice pleasure instead. Believe me, you will feel stupid by making your code look stupid, but your readers will thank you. It will in turn increase software quality and colaboration. Imo do not use this kind of stuff.
SoupIsReady - just another tool in the toolbox, and like many tools can be used in the wrong place for the wrong purpose - she highlighted that they should be used for simple throw away scenarios, the list search is a classic situation where they shine.
example of lambda saving the day: Using it to pass variables from a tkinter button into the generic function assigned to its "command" variable. Without Lambda, this would take a great deal of effort. With lambda, it is barely any extra code at all.
First we take a string, for example: "Isaac Asimov", then we use the split method for turning the string to a list: ["Isaac", "Asimov"]. Lastly we use [-1] to get the last string from the list, in this case: "Asimov". quick reminder: >>> list = ["a", "b", "c", "d"] >>> list[0] "a" >>> list[1] "b" >>>list[-1] "d" Hope I made it clear!
Userful for hacking and creating scripting functions that leave no footprints for the average person to crack. Nice. Good presentation. Great delivery...very dramatic. My compliments to the After FX/Matlab/Python scripter.
this is my first video to solving my lambda expression problem i accidently click the video and i shocked what is happening in this video 😮 then i realized this is the good way for the programmer to interact the viewers and help them by giving accurate and sufficient way to solve their problem 😃 THANK YOU FOR THIS VIDEO I SUBSCRIBED YOUR CHANNEL AND KEEP SUPPORTING BY GIVING A UNIQUE WAY OF STUDYING 😄
Who says lambdas don’t have names? ldo@theon:~> python3 Python 3.5.4 (default, Aug 31 2017, 12:22:39) [GCC 7.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> f = lambda x : x >>> f.__name__ ''
From my knowledge (before watching this video), lambda is simply the same as creating a function with only one line; the return thingy. For example, def X(l): return l[1:] + l[0] is the same as X = lambda l: x[1:] + x[0]
Humans may be sloppy when typing, but you should respect a user's spelling of their *own* name. If you only capitalize the first letter, then Georgia O'Keefe, Conan O'Brien, Bill O'Reilly, Rosie and Chris O'Donnel, Tip O'Neil, Maureen McGovern, Tracy McGrady, John McEnroe, etc. will be pretty upset that you changed their name in your sign-up procedure.
OMG!!! This is the best educational video 😄 i haven't ever enjoyed an educational video like i enjoyed this one! Way to go!! Like subscribe share for sure 🙋🏻♂️😄 so coool
I do not understand this part of the code and the question, I hope, is simple. What does [-1] do exactly and can someone explain in a simplified explanation as possible? (3:44) scifi_authors.sort(key = lambda name: name.split(" ")[-1].lower())
*Welcome to the HEV Mark 4 Protective System, for use in hazardous environment conditions. Power-assist movement activated. High-impact reactive armor activated. Atmospheric contaminant sensors activate. Vital signs monitoring activated. Automatic medical systems engaged. Defensive weapon selection system activated. Munition level monitoring activated. Communications interface online. Have a very safe day.*
For some reason I've always avoided your videos... now that I watch this lambda one... I'm hooked! Easy clear concise explanations, sorry I judged you!!!
uh.. anonymous functions are dumb. There's never a situation where using it is better or clearer than just naming a fricking function. I mean I'm all for my x>=y?x:y kind of stuff (thats c for those who don't speak it) but python is a scripting language thats designed to be easy to read. I don't get it.
Holy shit I'm glad I saw this. I was wondering why RU-vid recommended it to me. I was about to make the foolish mistake of becoming a pirate without knowing how to compute the trajectory of cannon balls! Phew!