Тёмный

Python lambda, map, filter, & reduce - Higher Order Functions for Beginners 

Dave Gray
Подписаться 341 тыс.
Просмотров 10 тыс.
50% 1

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 31   
@xzex2609
@xzex2609 Год назад
he is such a great teacher and I actually am learning JS from his channel . and even though I know python for years still enjoying to see his way of teaching. thanx
@Leesdjo
@Leesdjo Год назад
Thank you Dave. I have learned lots from you as a student when I first found out about your RU-vid channel. Thank you for your kindness.
@insteresting
@insteresting 10 месяцев назад
Very nice tutorial, Dave!
@OneStopMusic.
@OneStopMusic. 3 месяца назад
great and to the point explanation
@muzhaffarhaydar7928
@muzhaffarhaydar7928 22 дня назад
thanks dave!
@TannerBarcelos
@TannerBarcelos Год назад
I feel like seeing this in JavaScript before Python helps folks understand it even better. Sure, lambda arg: are a little different than ()=> but given Python isn’t functional in nature, I noticed many folks find this to be confusing. You did an awesome job explaining it!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Год назад
Thank you!
@xzex2609
@xzex2609 Год назад
once you see its actual use cases (call backs ,....) you will find that the lambda is a very effective tool you can't do without , maybe that's why pep-8 recommends that lambda should not be assigned ,cause its own use cases are very special , like in GUI programming if a widget need to pass one or two parameters to a function , you can not use a function for that unless you wrap your function inside an otter function that calls inner function to have a return value , but a simple lambda expression will save the day and you don't need to even define a function even if your command is a function like print( argument) you can't use () in your command= in your widget and you had to wrap the print inside a function otherwise print returns None but by using lambda you simply can use Button(......, command=lambda:print('string')) or command = lambda event:print(event). otherwise you got to use a higher order function (nested wrapper / inner) function
@ggff2269
@ggff2269 Год назад
Hey Dave, i am facing very slow compilation time in nextjs . A single change in file takes upto 60 seconds to appear and takes upto 2.5 gbs of ram. Also i am not using additional packages. I have noticed 1000s of devs facing same issue. How do you encounter this? It is very frustrating. It should have to be fast like vite. 😭😭😭 I really started hating it now but have to use it for SEO 😭😭😭😭
@DaveGrayTeachesCode
@DaveGrayTeachesCode Год назад
Duplicate question and this time on a Python video?? I answered under the appropriate Next.js video.
@sonamohialdin3376
@sonamohialdin3376 Год назад
Very helpful tutorial thank you very much
@DaveGrayTeachesCode
@DaveGrayTeachesCode Год назад
You're welcome!
@xzex2609
@xzex2609 Год назад
According to PEP-8 anonymous functions better not assign to a variable their use is more like call backs like arr.sort(key = lambda data:data[0]) and other stuff like that. but visual studio doesn't apply the pep-8 unless you install an extension. I remember the extension was very annoying , but now see it as a tool to learn pep 8 standards in the action to write better code.
@johnaweiss
@johnaweiss 8 месяцев назад
6:00 Would be helpful if your commented lambda rewrites inluded the var name as you had originally entered. Without the var name, the commented lambdas are not equivalent to the defs.
@xzex2609
@xzex2609 Год назад
once you see its actual use cases (call backs ,....) you will find that the lambda is a very effective tool you can't do without , maybe that's why pep-8 recommends that lambda should not be assigned ,cause its own use cases are very special , like in GUI programming if a widget need to pass one or two parameters to a function , you can not use a function for that unless you wrap your function inside an otter function that calls inner function to have a return value , but a simple lambda expression will save the day and you don't need to even define a function even if your command is a function like print( argument) you can't use () in your command= in your widget and you had to wrap the print inside a function otherwise print returns None but by using lambda you simply can use Button(......, command=lambda:print('string')) or command = lambda event:print(event). otherwise you got to use a higher order function (nested wrapper / inner) function
@danielurbanowicz7882
@danielurbanowicz7882 5 месяцев назад
Solution for reformat lambda by vs code is to put parentheses around the lambda assignment: squared = (lambda num: num * num) 😃
@aniruddhadas2953
@aniruddhadas2953 Год назад
Thank You,Sir.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Год назад
You're welcome!
@latesttrendzs
@latesttrendzs Год назад
Hey dave ! Just curious to know how coding teachers on RU-vid like you get there knowledge from. Where they get to know so details of those coding languages?
@DaveGrayTeachesCode
@DaveGrayTeachesCode Год назад
Documentation, books, other articles and tutorials, and experience - no secret or shortcut here. I teach at university and the same applies there.
@obiemmanuel354
@obiemmanuel354 Год назад
I love your contents a lot sir
@DaveGrayTeachesCode
@DaveGrayTeachesCode Год назад
So nice of you!
@obiemmanuel354
@obiemmanuel354 Год назад
@@DaveGrayTeachesCode I'm a beginner but hoping to get somewhere with your contents
@alexanderkomanov4151
@alexanderkomanov4151 Год назад
Thanks!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Год назад
Welcome!
@netronominom2850
@netronominom2850 Год назад
Your videos are amazing Is it possible to make a tutorial for decentralized crypto exchange?
@DaveGrayTeachesCode
@DaveGrayTeachesCode Год назад
Thank you! I have not gotten into crypto coding. There are some good channels for that.
@johnaweiss
@johnaweiss 8 месяцев назад
1:34 My vscode doesn't do this conversion, so i'm guessing you have a formatter extension installed, such as "black". So that's not a native vscode behavior. 15:01 My vscode doesn't move imports to the top. Again, i'm guessing you have a formatter extension.
@JHunterJoe
@JHunterJoe Год назад
it re formatting because your not calling the lamda function right
@utinthein7274
@utinthein7274 Год назад
Thank you, sir
@DaveGrayTeachesCode
@DaveGrayTeachesCode Год назад
Welcome!
Далее
Python Closures for Beginners | Python tutorial
19:32
Python higher order functions 👑
6:28
Просмотров 37 тыс.
Python 101: Learn the 5 Must-Know Concepts
20:00
Просмотров 1,2 млн
Array Methods in JavaScript | 17 Useful Methods
42:39
Python File Handling for Beginners
22:40
Просмотров 14 тыс.
Python Lists & Tuples for Beginners | Python tutorial
32:01
Python Scope tutorial for Beginners
19:50
Просмотров 8 тыс.
5 Good Python Habits
17:35
Просмотров 539 тыс.
Python Functions for Beginners | Python tutorial
15:15