Know what is the difference between filter, reduce and map: map: Takes a function f, and a list L1, and returns a list L2 obtained by applying f to every element of L1. Say f is a function that takes x and returns 2x. Then, map(f, [1,2,3,4]) returns [2,4,6,8]. reduce: Takes a binary operator f, a list L and a seed value (or identity element). It returns the seed value if the list is empty. Otherwise, it applies the binary operator f to the seed and first element of L, then applies f to the result of this and the 2nd element of L, and so on till L is exhausted. The result is returned. This can be seen as a generalization of factorial function. filter: Takes a boolean function f and a list L1. It applies the function to each element of L1, and list of those elements that give true is returned. #insmot
@kirubhaharkannan54614 жыл бұрын
Awesome
@mandvi88873 жыл бұрын
map function always returns an object. One need to convert to list explicitly.
@bountyhead55372 жыл бұрын
Thanks brother
@kogurwarsrisai69472 жыл бұрын
didn't get about reduce function
@SumanGorkhali-z1k Жыл бұрын
Perfect
@vikrantthakur38184 жыл бұрын
Finally found a cool programmeer who teaches these concepts in best possible way❤❤😇 Thanks navin sir
@hrutikdhumal4024 жыл бұрын
this is one of the best python tutorial series for begineers and the main part is it is free thank you sir
@sunilmaurya38154 жыл бұрын
the form of steps u choose while teaching is unique and more understandable as compared to other lecturers thank u sir great explanation☺️
@muskaan32065 жыл бұрын
Sir, you have made boring topics interesting for us..i love your teaching method..Great job!!
@NitinJainNoida5 жыл бұрын
In case anyone need more information about the difference between filter, map and reduce: Difference 1: 1. 'Map' takes all objects in a list and allows you to apply a function to it. The result is usually the same quantity of items as in the main list but with some execution(as specified in the function). 2. 'Filter' takes all objects in a list and runs that through a function to create a new list with all objects that return True in that function. Not necessary that it will output same number of items as present in the main list. Difference 2: 1. In Map you can use multiple iterables definition : map(function_object, iterable1, iterable2,...) 2. Whereas in filter only one iterable can be used definition : filter(function_object, iterable) Difference 3: Further in filter the function_object has to return boolean only. Hope it helps! :) #insmot
@rahulvaswani88665 жыл бұрын
thanks a lot
@islamgoher5 жыл бұрын
Hey, Thanks for this clarification. but, you didn't mention the purpose of reduce function there :)
@vivekpandey5142 Жыл бұрын
It's helpful
@hemajeyalakshmi91064 жыл бұрын
oh god! you are simply answering all the questions that pop my head. thank you navin. you have no idea what a great part you are holding in my life. because of you, im fearless and ready to learn programming. thank you for saving my life.
@nehaaadarsh4 жыл бұрын
Lambda is my new crush ,😍😍❤️❤️ I love lambda
@sidskywalker84234 жыл бұрын
Indeed!
@intelligentbrahman15723 жыл бұрын
really pandey g,....i am also pandey............are u student??
@sathvikmalgikar28422 жыл бұрын
finally found a good tutor who does'nt just dump all the codes and and leave logic behind completely making it boring and useless to watch. really amazing sir.
@pvinoth21463 жыл бұрын
Hello Sir, Thanks so much for the lessons. I have coded factorial of a number using reduce functions. Its working:-) from functools import reduce s=[] n=int(input("Enter the number")) for i in range(n+1): if i==0: continue else: s.append(i) print(s) total = reduce(lambda a,b: a*b,s) print(total)
@swarnimasingh12325 жыл бұрын
"that's what programmers do, making things cool" and how cool he looks with that action ;)
@harshwardhansingh6173 жыл бұрын
makkhan lagana band karo rre xD
@webcreationstudio70883 жыл бұрын
@@harshwardhansingh617 lol tum toh bare heavy driver ho
@SumanGorkhali-z1k Жыл бұрын
such a headache of lambda syntax clarified so simply. Thankx.
@mohittrivedi11126 жыл бұрын
Seriously your Python videos are amazing. kudos to you
@uvishnuprasad29443 жыл бұрын
from functools import * num = [2,4,5,6,7,8,9,1,0] odds =(list(filter(lambda n: n%2!=0 ,num))) square=(list(map(lambda a: a*a,odds))) sum=(reduce(lambda x,y: x+y,square)) print(sum)
@HimanshuVerma-rr2ww5 жыл бұрын
So enjoyable your teaching skill. Really i am getting all this things free. Thanks sir great heads off.
@MegaCherry04 жыл бұрын
Class Moniter could you please let me know whether this channel has videos on python and are they easy to understand? Thanks in advance.
@truthalonetriumphs65724 жыл бұрын
"Hats off" is the expression
@SaFFire123x4 жыл бұрын
@@MegaCherry0 This is a reply after 7 months but I can confidently say that this is the best channel for python. I regret not discovering this channel earlier
@MegaCherry04 жыл бұрын
SaFFire thank you so much buddy.
@SaFFire123x4 жыл бұрын
@@MegaCherry0 you're welcome. I'm 7 months late though 😅
@swethagopu37084 жыл бұрын
Your smart explanation helps me to get out of my fear in learning python😍😍😍
@murodjonsadullaev46744 жыл бұрын
I like the way you teach us, Navin. I am learning a lot from your videos. From this video, I learned how to find Factorials of a number with just two lines of code using reduce. from functools import reduce print(reduce(lambda a, b: a * b, range(1, int(input("Enter a number: ")) + 1))) cool bro, really appreciate your help on learning python :)
@yfjsdgzjdnfn2 жыл бұрын
Factorial!!!
@divyeshkumarbalar77325 жыл бұрын
i was married to java and its version 8 features; after watching this i am planning to cheat in my relationship
@mukeshcheemakurthi79335 жыл бұрын
you will be presented in the court if you do this :)
@divyeshkumarbalar77325 жыл бұрын
I will stay faithful to both Ill treat java as a friend (friendzoned)
@sravanichowdary77554 жыл бұрын
😝
@sumaiyathameem58884 жыл бұрын
😃
@INDIAN-kq6yo4 жыл бұрын
Java will divorce you
@rohithjohn9594 жыл бұрын
Sir...your teachings are awesome and you are a blessing to a lot of new programmers
@PrasannaKumar-zx7gr4 жыл бұрын
Than you sir, after working out this problem myself in laptop, this become simple now... You are a greater teacher and thanks for making me to sit here till above 40 video series. Everyday waking up with your videos make my day very active.... Thank you!
@deepwell85546 жыл бұрын
You are a teacher of note ... not only a coder ... Thanks for the effort. If I can do anything to help you expand ( other than liking or subscribing ), let me know.
@Vikranth4A56 жыл бұрын
Navin sir can u make more videos and more concepts as soon as possible because we are understand very easy with ur explaination NOTE : TRY TO MAKE SOME PROJECTS AND SOFTWARE USING THIS CONCEPTS
@DirisalaSandeepKumar2 ай бұрын
demanding huh.....
@tamaladhikari795010 ай бұрын
Comparaing it with java in java we have to use -> operator here only : and also here we have to write lambda
@vrowmuria6 жыл бұрын
Many many thanks Navin for clearing the concept of Map Reduce. You are a gem. Super likes
@allofmystuffs4 жыл бұрын
Legend says, the hardest part of programming is naming the variables.
@wqwerisk28953 ай бұрын
Thank you! Wishing you all the best 🙏🏼
@zakiasmaa68343 ай бұрын
"that's what programmers do, making things cool" ; thank you a lot Navin Sir
@RaiyanAlphaRanger3 жыл бұрын
This is so amazing! I learnt a whole lot about not just lambda from this video, but also these three other useful (albeit advances) functions! Thank you so much!
@uchiha_love2 ай бұрын
I have watched so many tutorials and had no idea until i watch this masterpiece🎉
@mattshubat4 жыл бұрын
Love how you kept in your mistakes. Very honest.
@WanderEatLearn2 жыл бұрын
Very helpful to me. It's crystal clear. Prior to watching this video I could not understand filter and map.
@shantabaikanade60754 жыл бұрын
You are really a fabulous teacher 🤩🤩🤩
@prashantbhatade6367 Жыл бұрын
After watching this video my all doubt got clear hats off to sir quality and method of teaching lit.. Tx
@naveenpolasu46705 жыл бұрын
Sir, Can you please start Machine learning with Python tutorial.
@beecrofttobiloba18695 ай бұрын
Sir this is very necessary
@asishraz61734 жыл бұрын
After a long time, I finally understood the concept of Lambda, Reduce, Map function. Great video and well explained. Thank you so much sir. Now eager to learn more and more every day through your videos. Thank you so much, keep up the great work.
@kaikobadshamim61185 ай бұрын
Your teaching technique is so lovely!!!
@shivakumarreddyp87644 жыл бұрын
This is the Beauty of python.... And sir hats off for ur teaching
@أبوفاطمة_أبوعبدالله5 ай бұрын
Your explanation is very awesome. Thanks a lot!!
@ashutoshpatil266 жыл бұрын
simple and clean Explanation thank you sir
@italiens99053 жыл бұрын
you are awesome teacher ever ... And your teaching style is really energetic
@wwmcgregor90315 жыл бұрын
Navin you are a great teacher!
@meghhanigam83753 жыл бұрын
You are the best.... no teacher ca teach like you
@huzaifaelnaeem16205 жыл бұрын
it's brief and clear .Thank you so much sir
@voalcalisticTanmay6 жыл бұрын
I have made a use of lambda and map() method and would like to share .. And here is the snippet : a,b=[int(x) for x in input("Enter two values seperated with spaces : ").split()] tup=( lambda c,d : c+d, lambda c,d : c-d , lambda c,d : c*d , (lambda c,d : (c+d)/2)) dic=dict(zip(('Sum' , 'Difference' , 'Product' , 'Average'),map(lambda x : x(a,b),tup))) for j in dic: print("{} : {}".format(j,dic[j])) Hope this gets useful in some way. Thank You :)
@pranaymane234 жыл бұрын
Find average of list: from functools import reduce list = [1,2,3,4,5,6,7,8] ave = reduce(lambda a,b: a+b,list)/len(list) print(ave)
@rohanram71975 жыл бұрын
Navin sir you are a legend 🙏🏻❣️ Thanks again
@chinmaydas40536 жыл бұрын
Very important video but please sir try to upload more videos daily. After uploading complete series please sir make some projects/softwares.. it will be very helpful to understand the real world problems 🙏🙏🙏..
@jaheerkalanthar8164 жыл бұрын
sir , U r my hero shall i tell in my mother toungue, Marana mass
@allofmystuffs4 жыл бұрын
Sorry to ask. Which language.?
@iloveyou-gk7cw4 жыл бұрын
@@allofmystuffs tamil
@rehithkrishna5434 жыл бұрын
Thalaivar 🔥
@mohammedumarfarhan99002 жыл бұрын
This man is an absolute legend
@nagendrabommireddi84372 жыл бұрын
if we use for loop to seperate evens than it will take time complexcity o(n)..by using lambda what is the time complexicity
@venupunna99403 жыл бұрын
Great tutorial and by the way THANKYOU for making these videos AD FREE.
@pareshdandane6 жыл бұрын
I saw you video after 2 months and editing level is whole different level. I got so much inspiration from you. thank you sir for making this video!!
@BhuveshDhiman5 жыл бұрын
4:03 best part of the Video thank me later
@Kirtidancevideos4 жыл бұрын
😂😂😂😂🤣🤣🤣
@ShikharShukla994 жыл бұрын
🤣🤣
@arbaazkhan75334 жыл бұрын
That scene was really funny The way he said
@_.sunnyraj._4 жыл бұрын
😂
@cnx_14413 жыл бұрын
I thought your vids were useless at the first but then I understood that your vids r very helpful thank you soo much.
@mahalingpreethi10212 жыл бұрын
Sir, all lambda functions are working similar(filter(),map(),reduce()). Then what is the main difference between them. Among three which function is better to use.
@shreyaswinividhyadhare92284 жыл бұрын
Sir your class is fantastic, more understandable
@lasithdissanayake3 жыл бұрын
this was the only tutorial I undestood about map filter an reduce
@Think_differently9555 жыл бұрын
Great Playlist for Python. I like it. One doubt here, how a+b added all variables without using any loop?
@mohitsharma46674 жыл бұрын
if we have the list abc = [1,2,3,4] it will take the first two elements from the list and perform the function, the new list now becomes [3,3,4] the process is repeated till we have a single value
@sidskywalker84234 жыл бұрын
@@mohitsharma4667 for e.g , l = [2, 4, 6, 8] >>> reduce(add_all, l) 2 + 4 --> 6 6(2 + 4) + 6 --> 12 12(6 + 6) + 8 --> 20 final sum: 20 that's how reduce() works! :)
@054_ritesh34 жыл бұрын
The next level of awesome teaching
@webcreationstudio70883 жыл бұрын
code --> from functools import reduce def adding(a,b): return a+b def update(n): return n*2 num=[1,2,3,4,5,6,7,8,9,10] even=list(filter(lambda x:x%2==0,num)) print(f"even numbers are {even}") double=list(map(lambda x:x*2,even)) print(f"double of all the even numbers {double}") sum=reduce(lambda x,y:x+y,double) sum=str(sum).center(10) print(f"the addition of all the numbers ae present in the double are {sum}")
@dipannita74364 жыл бұрын
u makes the concept understandable
@b.sasikumar21414 жыл бұрын
I like the way of u teaching sir superb...... 👌👌
@MukeshKumar-co5ky4 жыл бұрын
from functools import reduce lst = [2,4,5,25,21,66] evens = list(filter(lambda n : n%2==0,lst)) doubles = list(map(lambda n : n*2,evens)) sum = (reduce(lambda a,b : a+b,doubles)) print(evens) print(doubles) print(sum)
@sumantharaja92242 жыл бұрын
from functools import reduce nums = [1,2,3,4] odds = list(filter(lambda n:n%2==1,nums)) print(odds) x = list(map(lambda n:5*n, odds)) print(x) y = reduce(lambda a,b:a+b,x) print(y) Output [1,3] [5,15] 20
@sufiyanmogal15272 жыл бұрын
Sir please start with python on these weekend it will help those people who are watching your python playlist
@a.rhithesh77114 жыл бұрын
navin sir i am very happy for your lectures, its very clear cut and good ...a request form my side to plan videos on problem solving python, which is used for placements for some lakhs of engineering students...i am expecting that one.
@ruwindarowel82002 жыл бұрын
Hands down the best place to learn Python❤❤❤❤❤❤
@atulayagupta7854 жыл бұрын
from functools import * numbs = [] n=int(input("Enter the number of value to be added:")) for i in range(n): a = int(input("Enter the value: ",)) numbs.append(a) result = reduce(lambda a,b : a+b, numbs) print(numbs) print(result)
@fhdhejeh635 жыл бұрын
you are helping many people sir. keep going
@ngharish3 жыл бұрын
i knew lamda function but filter ,map and reduce is useful for handling huge data ... so thanks for video
@abhaykanwasi8812 жыл бұрын
Big Data concept is so relatable for me to understand this concept.❤❤
@vanshchauhan23732 жыл бұрын
loved the method of your explaining
@jyoshnadeepala4439 Жыл бұрын
1:05 , chris Evans should listen this😂😂. #CaptainAmarica
@vivektanwar6285 ай бұрын
perfectly explained thanks,,,was confused earlier
@dineshr38414 жыл бұрын
Really awesome explanation about this topic, I really love it and understood very well by ur way of teaching...🙏❤️
@akshaydange8464 жыл бұрын
taking input from user performed all the map reduce and filter hope it will help anyone from functools import reduce nums=[] n=int(input('enter the elements')) for i in range(0,n): ele=int(input()) nums.append(ele) even = list(filter(lambda n:n%2==0,nums)) print(even) double=list(map(lambda n:n*2,even)) print(double) sum=reduce(lambda a,b:a+b,double) print(sum)
@aakashmehta73364 жыл бұрын
Hi Navin. Your videos are amazing. I am following your python series. I wanted to know from where did you learn the big data? I saw you said that you have learnt big data. Could you you please let me know the reference please? I want to learn big data.
@memeea6484 Жыл бұрын
Thank you so much the only tutorial that i can actually understand!! ♥♥
@emsshafeeq6 жыл бұрын
nums =[1,2,3,4,5,6,7] evens = list(map(lambda n: n % 2 == 0,nums)) print(evens) if the function is a condition then it will give true or false according to the input output : [False, True, False, True, False, True, False]
@vakhariyajay22242 жыл бұрын
Thank you very much. You are a genius.
@vidhikumawat58764 жыл бұрын
Navin sir thank you soo much for this series...I learned alot from this series...it is very easy and helpful..thank you soo much for your efforts ☺️☺️
@ashishgaur8626 жыл бұрын
Awesome work sir and please make more videos like these and give us some projects and assignment 👍🏻💯
@atulayagupta7854 жыл бұрын
numbs =[] n = int(input("Enter the number of elements you want to enter: ")) for i in range(n): a = int(input("Enter the value:")) numbs.append(a) evens = list(filter(lambda a : a%2==0,numbs)) print(evens)
@iqbalhonnur44512 жыл бұрын
Excellent explanation !!!
@deepthireddy4036 Жыл бұрын
I really like the way you explain concepts❤
@dreamphoenix Жыл бұрын
Excellent teaching. Thank you.
@easydatascience2508 Жыл бұрын
You can see mine too. Hope the Python playlist, step by step sequentially arranged by sections, will be valuable. Source files can be found in the description of the each video. There is another playlist , R beginning course in the channel too.
@amitroy-kh1wn5 жыл бұрын
Sir, How can you describe so easily and understandably. Hats off Sir
@inganzamarumpu4 жыл бұрын
all things are clear but i really like comprehensions
he said that these functions are not easy, but I found them so easy : P
@chaithalikshetty4802 жыл бұрын
Sir all I can say is your perfect..
@professor70323 жыл бұрын
' ' ' He is Literally Great ' ' '
@dishankshah50806 жыл бұрын
After completing basic please make some projects.It will give us more help.
@muhammadsultanularafin88464 жыл бұрын
Wonderfully explained! Thanks.
@oliviayeo57535 жыл бұрын
LAMBDA 4:03 LMAO Thank you for the tutorial!
@sasidhar53163 жыл бұрын
from functools import * lst=[1,2,3,4,5,6,7,8,9] even=list(filter(lambda n : n%2!=0,lst)) double=list(map(lambda i : i*2,even)) add=reduce(lambda a,b : a+b,double) print(even) print(double) print(add)
@atulayagupta7854 жыл бұрын
list = [] n = int(input("Enter the number of elements you want to enter: ")) for i in range(n): a = int(input("Enter the value:")) list.append(a) if a % 2 == 0: print("It is an even number : ", a) else: print("it is an odd number") print(list)
@dadmehrtatality11444 жыл бұрын
Hey man tnx for your help I was really confused but now I find it out !!😍