Python List Use Cases & Real Time Scenarios | Solve the hardest problem using List Comprehension ๐Ÿ”ฅ

  ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 12,061

Sumit Mittal

Sumit Mittal

ะšาฏะฝ ะฑาฑั€ั‹ะฝ

๐–๐š๐ง๐ญ ๐ญ๐จ ๐Œ๐š๐ฌ๐ญ๐ž๐ซ ๐’๐๐‹? ๐‹๐ž๐š๐ซ๐ง ๐’๐๐‹ ๐ญ๐ก๐ž ๐ซ๐ข๐ ๐ก๐ญ ๐ฐ๐š๐ฒ ๐ญ๐ก๐ซ๐จ๐ฎ๐ ๐ก ๐ญ๐ก๐ž ๐ฆ๐จ๐ฌ๐ญ ๐ฌ๐จ๐ฎ๐ ๐ก๐ญ ๐š๐Ÿ๐ญ๐ž๐ซ ๐œ๐จ๐ฎ๐ซ๐ฌ๐ž - ๐’๐๐‹ ๐‚๐ก๐š๐ฆ๐ฉ๐ข๐จ๐ง๐ฌ ๐๐ซ๐จ๐ ๐ซ๐š๐ฆ ๐›๐ฒ ๐’๐ฎ๐ฆ๐ข๐ญ ๐’๐ข๐ซ!
"๐€ 8 ๐ฐ๐ž๐ž๐ค ๐๐ซ๐จ๐ ๐ซ๐š๐ฆ ๐๐ž๐ฌ๐ข๐ ๐ง๐ž๐ ๐ญ๐จ ๐ก๐ž๐ฅ๐ฉ ๐ฒ๐จ๐ฎ ๐œ๐ซ๐š๐œ๐ค ๐ญ๐ก๐ž ๐ข๐ง๐ญ๐ž๐ซ๐ฏ๐ข๐ž๐ฐ๐ฌ ๐จ๐Ÿ ๐ญ๐จ๐ฉ ๐ฉ๐ซ๐จ๐๐ฎ๐œ๐ญ ๐›๐š๐ฌ๐ž๐ ๐œ๐จ๐ฆ๐ฉ๐š๐ง๐ข๐ž๐ฌ ๐›๐ฒ ๐๐ž๐ฏ๐ž๐ฅ๐จ๐ฉ๐ข๐ง๐  ๐š ๐ญ๐ก๐จ๐ฎ๐ ๐ก๐ญ ๐ฉ๐ซ๐จ๐œ๐ž๐ฌ๐ฌ ๐š๐ง๐ ๐š๐ง ๐š๐ฉ๐ฉ๐ซ๐จ๐š๐œ๐ก ๐ญ๐จ ๐ฌ๐จ๐ฅ๐ฏ๐ž ๐š๐ง ๐ฎ๐ง๐ฌ๐ž๐ž๐ง ๐๐ซ๐จ๐›๐ฅ๐ž๐ฆ."
๐‡๐ž๐ซ๐ž ๐ข๐ฌ ๐ก๐จ๐ฐ ๐ฒ๐จ๐ฎ ๐œ๐š๐ง ๐ซ๐ž๐ ๐ข๐ฌ๐ญ๐ž๐ซ ๐Ÿ๐จ๐ซ ๐ญ๐ก๐ž ๐๐ซ๐จ๐ ๐ซ๐š๐ฆ -
๐‘๐ž๐ ๐ข๐ฌ๐ญ๐ซ๐š๐ญ๐ข๐จ๐ง ๐‹๐ข๐ง๐ค (๐‚๐จ๐ฎ๐ซ๐ฌ๐ž ๐€๐œ๐œ๐ž๐ฌ๐ฌ ๐Ÿ๐ซ๐จ๐ฆ ๐ˆ๐ง๐๐ข๐š) : rzp.io/l/SQLINR
๐‘๐ž๐ ๐ข๐ฌ๐ญ๐ซ๐š๐ญ๐ข๐จ๐ง ๐‹๐ข๐ง๐ค (๐‚๐จ๐ฎ๐ซ๐ฌ๐ž ๐€๐œ๐œ๐ž๐ฌ๐ฌ ๐Ÿ๐ซ๐จ๐ฆ ๐จ๐ฎ๐ญ๐ฌ๐ข๐๐ž ๐ˆ๐ง๐๐ข๐š) : rzp.io/l/SQLUSD
๐–๐š๐ง๐ญ ๐ญ๐จ ๐ฅ๐ž๐š๐ซ๐ง ๐๐ข๐  ๐ƒ๐š๐ญ๐š ๐›๐ฒ ๐’๐ฎ๐ฆ๐ข๐ญ ๐’๐ข๐ซ?
๐œ๐ก๐ž๐œ๐ค๐จ๐ฎ๐ญ ๐ญ๐ก๐ž ๐›๐ข๐  ๐๐š๐ญ๐š ๐œ๐จ๐ฎ๐ซ๐ฌ๐ž ๐๐ž๐ญ๐š๐ข๐ฅ๐ฌ
๐–๐ž๐›๐ฌ๐ข๐ญ๐ž : trendytech.in/...
I have trained over 20,000+ professionals in the field of Data Engineering in the last 5 years.
Follow me one different Platforms!
Twitter: / bigdatasumit
LinkedIn: / bigdatabysumit
Instagram: / bigdatabysumit
In this session I have covered:
- List comprehension in depth
- unpacking
- range
- slicing list
- appending 2 lists
- extending 2 lists
- enumerate in python
- 3 assignments
Assignment 1 -
['CLOSED', 'PENDING_PAYMENT', 'COMPLETE', 'CLOSED', 'COMPLETE', 'COMPLETE', 'COMPLETE', 'PROCESSING', 'PENDING_PAYMENT', 'PENDING_PAYMENT']
Find the count of each order status
Assignment 2 -
[ [1, 100, 'success'],
[2, 200, 'pending'],
[3, 150, 'success'],
[4, 300, 'failed'],
[5, 400, 'success'],
[6, 250, 'pending'],
[7, 350, 'failed'],
[8, 450, 'success'],
[9, 500, 'pending'],
[10, 600, 'failed']
]
output :
success: 4
pending: 3
failed: 3
Assignement 3:
[
[101, 'John', 'IT', 60000],
[102, 'Alice', 'HR', 50000],
[103, 'Bob', 'Finance', 70000],
[104, 'Emma', 'IT', 55000],
[105, 'David', 'Finance', 75000],
[106, 'Sophia', 'HR', 48000]
]
find the average salary for each department
Sample output:
Finance: Average Salary - 72500
.
.
#python #dataengineering #dataanalyst

ะŸั–ะบั–ั€ะปะตั€: 68
@shrutisamal
@shrutisamal 6 ะฐะน ะฑาฑั€ั‹ะฝ
I have taken up many paid and unpaid python courses from a number of popular programs out there but never got this much clarity and understanding on list comprehension. Your method of teaching with so many real time scenarios is truly exceptional. The content is pure gold. Underrated channel. Thank you so much Sumit Sir! looking forward to the upcoming session
@sumitmittal07
@sumitmittal07 5 ะฐะน ะฑาฑั€ั‹ะฝ
Great to hear!
@faizanmidda1337
@faizanmidda1337 6 ะฐะน ะฑาฑั€ั‹ะฝ
Sir. Also please teach OS module and how to handle excel files. I love the way you teach.
@vandanapatil8182
@vandanapatil8182 6 ะฐะน ะฑาฑั€ั‹ะฝ
Best teacher in india ๐Ÿ˜Š๐ŸŽ‰
@sumitmittal07
@sumitmittal07 5 ะฐะน ะฑาฑั€ั‹ะฝ
thank you for tour kind words
@sribalaji7131
@sribalaji7131 5 ะฐะน ะฑาฑั€ั‹ะฝ
for the world๐Ÿ’Œ
@venkateshkannan7398
@venkateshkannan7398 6 ะฐะน ะฑาฑั€ั‹ะฝ
Best video on lists and tuples!
@sumitmittal07
@sumitmittal07 5 ะฐะน ะฑาฑั€ั‹ะฝ
Yay! Thank you!
@vishal-ox3zd
@vishal-ox3zd 5 ะฐะน ะฑาฑั€ั‹ะฝ
Hi Sumit Sir , I just love the way you are teaching. I have seen many youtube videos on python but this python course is unique.the content of this course helps me a lot to understand many concepts of python. Please share some more concepts of python which will help data engineers like us. Really you are a great teacher ๐Ÿ™ Thanks a lot.
@vandanapatil8182
@vandanapatil8182 6 ะฐะน ะฑาฑั€ั‹ะฝ
Sir we want same type of in depth lectures/playlist on Excel & power BI for Data Analyst with real industry relevant projects ๐Ÿ˜Š
@arunsundar3739
@arunsundar3739 6 ะฐะน ะฑาฑั€ั‹ะฝ
it was fun to know & see the benefits of List comprehension & various other concepts of Python, had little hesitancy to learn one another programming language, now i can embrace Python after seeing it is easy to learn from this Python series & also more importantly apply it in Pyspark code :)
@sidhantdorge2445
@sidhantdorge2445 5 ะฐะน ะฑาฑั€ั‹ะฝ
Hey guys, Sharing my approach which I used to solve the Assignments that Sumit Sir mentioned in the session Assignment-1: status_list = ['CLOSED', 'PENDING_PAYMENT', 'COMPLETE', 'CLOSED', 'COMPLETE', 'COMPLETE', 'COMPLETE', 'PROCESSING', 'PENDING_PAYMENT', 'PENDING_PAYMENT'] status_list_set = set(status_list) print(status_list_set) order_status_count = [(status,status_list.count(status)) for status in status_list_set] print(order_status_count) Assignment-2: order_list = [ [1, 100, 'success'], [2, 200, 'pending'], [3, 150, 'success'], [4, 300, 'failed'], [5, 400, 'success'], [6, 250, 'pending'], [7, 350, 'failed'], [8, 450, 'success'], [9, 500, 'pending'], [10, 600, 'failed'] ] order_list_status = [orders[2] for orders in order_list] order_list_status_set = set(order_list_status) status_count = [(status, order_list_status.count(status)) for status in order_list_status_set] for status in status_count: print(f"{status[0]} : {status[1]}") Assignment-3: employee_salary = [ [101, 'John', 'IT', 60000], [102, 'Alice', 'HR', 50000], [103, 'Bob', 'Finance', 70000], [104, 'Emma', 'IT', 55000], [105, 'David', 'Finance', 75000], [106, 'Sophia', 'HR', 48000] ] finance_sal=[] it_sal = [] hr_sal = [] for item in employee_salary: if item[2] == "IT": it_sal.append(item[3]) elif item[2] == "HR": hr_sal.append(item[3]) else: finance_sal.append(item[3]) finance_avg_sal = sum(finance_sal)/len(finance_sal) hr_avg_sal = sum(hr_sal)/len(hr_sal) it_avg_sal = sum(it_sal)/len(it_sal) print(f"Finance: Average Salary - {finance_avg_sal}") print(f"IT: Average Salary - {it_avg_sal}") print(f"HR: Average Salary - {hr_avg_sal}") Please feel free to add any suggestions you have or any doubts that you need to clarify, I am happy to help.
@DileepNelliakkattu
@DileepNelliakkattu 3 ะฐะน ะฑาฑั€ั‹ะฝ
One problem with this solution is that this code needs to change when the input has more departments, so this is not a generic solution
@abhishekn786
@abhishekn786 6 ะฐะน ะฑาฑั€ั‹ะฝ
Top notch content sir, really loved it. please upload videos as fast as you can. Thanks
@sumitmittal07
@sumitmittal07 5 ะฐะน ะฑาฑั€ั‹ะฝ
glad that you enjoyed the session
@venkateshkannan7398
@venkateshkannan7398 5 ะฐะน ะฑาฑั€ั‹ะฝ
Solution to Assignment3(my tiny contribution). Im using defaultdict(), a subclass of Dictionary. I find it handy when working with lists. from collections import defaultdict company_average = defaultdict(list) for sublist in company: company_average[sublist[2]].append(sublist[3]) average_salaries = {department: sum(salaries) / len(salaries) for department, salaries in company_average.items()} print(average_salaries)
@sumitmittal07
@sumitmittal07 5 ะฐะน ะฑาฑั€ั‹ะฝ
that's great
@gauravrai4398
@gauravrai4398 3 ะฐะน ะฑาฑั€ั‹ะฝ
๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ on fire content .... many thanks Sumit Sir .... i am a bit late but catching up on all the videos in this playlist
@ArpitSrivastava1994
@ArpitSrivastava1994 6 ะฐะน ะฑาฑั€ั‹ะฝ
Very clear and super helpful examples taken
@sumitmittal07
@sumitmittal07 6 ะฐะน ะฑาฑั€ั‹ะฝ
Glad it was helpful!
@swapnam1528
@swapnam1528 3 ะฐะน ะฑาฑั€ั‹ะฝ
Videos are really helpful. I have not seen such videos with real time examples. i am truly enjoying the sessions. Sir is it possible to create video for oops concepte.
@prashantchourasiya1202
@prashantchourasiya1202 5 ะฐะน ะฑาฑั€ั‹ะฝ
Wonderful as expected...
@vikaschavan6118
@vikaschavan6118 6 ะฐะน ะฑาฑั€ั‹ะฝ
Incredible, i enjoyed thoroughly. Just one question sir when we are doing word count, do you really feel we need to remove duplicate first? For example a paragraph may certain words which were repeated. If we remove duplicates then it will not give the result which we are looking for. Please share your thoughts on this
@vikaschavan6118
@vikaschavan6118 6 ะฐะน ะฑาฑั€ั‹ะฝ
input_list = ['CLOSED', 'PENDING_PAYMENT', 'COMPLETE', 'CLOSED', 'COMPLETE', 'COMPLETE', 'COMPLETE', 'PROCESSING', 'PENDING_PAYMENT', 'PENDING_PAYMENT'] status_cnt = [(status,input_list.count(status)) for status in input_list] print(status_cnt) #[('CLOSED', 2), ('PENDING_PAYMENT', 3), ('COMPLETE', 4), ('CLOSED', 2), ('COMPLETE', 4), ('COMPLETE', 4), ('COMPLETE', 4), ('PROCESSING', 1), ('PENDING_PAYMENT', 3), ('PENDING_PAYMENT', 3)] unique_status_cnt = list(set(status_cnt)) print(unique_status_cnt) #[('COMPLETE', 4), ('PENDING_PAYMENT', 3), ('CLOSED', 2), ('PROCESSING', 1)] O/P: [('COMPLETE', 4), ('PENDING_PAYMENT', 3), ('CLOSED', 2), ('PROCESSING', 1)] Removing duplicate first--> gives wrong output input_list = ['CLOSED', 'PENDING_PAYMENT', 'COMPLETE', 'CLOSED', 'COMPLETE', 'COMPLETE', 'COMPLETE', 'PROCESSING', 'PENDING_PAYMENT', 'PENDING_PAYMENT'] input_list_unique =list(set(input_list)) #removed duplicates status_cnt = [(status,input_list_unique.count(status)) for status in input_list_unique] print(status_cnt) #[('COMPLETE', 1), ('CLOSED', 1), ('PENDING_PAYMENT', 1), ('PROCESSING', 1)] O/P: [('COMPLETE', 1), ('CLOSED', 1), ('PENDING_PAYMENT', 1), ('PROCESSING', 1)]
@siddhantmishra6581
@siddhantmishra6581 ะะน ะฑาฑั€ั‹ะฝ
Assignment 3: seta = set() for sublist in employee: seta.add(sublist[2]) lista = list(seta) print(lista) IT =[] HR =[] Finance =[] for sublist in employee: if sublist[2] == lista[0]: IT.append(sublist[3]) elif sublist[2] == lista[1]: HR.append(sublist[3]) else: Finance.append(sublist[3]) print("IT :%.2f"%(sum(IT)/len(IT))) print("HR :%.2f"%(sum(HR)/len(HR))) print("Finance :%.2f"%(sum(Finance)/len(Finance)))
@arpithaks3467
@arpithaks3467 6 ะฐะน ะฑาฑั€ั‹ะฝ
please share running notes
@ManishSharma-wy2py
@ManishSharma-wy2py 6 ะฐะน ะฑาฑั€ั‹ะฝ
It was great learning โค
@mehulthakur5449
@mehulthakur5449 9 ะบาฏะฝ ะฑาฑั€ั‹ะฝ
dep_avg_sal = [] emp_department = [ emp[2] for emp in employees ] emp_set = set(emp_department) for emp_dep in emp_set: count = 0 total_sum = 0 for dep_sal in employees: if dep_sal[2] == emp_dep: total_sum += dep_sal[3] count += 1 sal_avg = total_sum / count dep_avg_sal.append((emp_dep, sal_avg)) print(dep_avg_sal)
@swapnam1528
@swapnam1528 3 ะฐะน ะฑาฑั€ั‹ะฝ
nested_lists=[[i,i**2,i**3] for i in range(1,4)] print(nested_lists)
@DileepNelliakkattu
@DileepNelliakkattu 3 ะฐะน ะฑาฑั€ั‹ะฝ
Below is the solution for 3rd question, Please suggest your improvements as this looks very complex to me dept_list=[i[2] for i in data] dept_set=set(dept_list) dept_count=[(i,dept_list.count(i)) for i in dept_set] print(dept_count) dept_sum=[ (j[2],j[3]) for i in dept_set for j in data if j[2]==i] print(dept_sum) for i in dept_count: count = 0 sum = 0 for j in dept_sum: if i[0]==j[0]: count += 1 sum+=j[1] if i[1]==count: avg=sum/count print(f'{i[0]}:Averege salary {avg}')
@azharaktherk2432
@azharaktherk2432 6 ะฐะน ะฑาฑั€ั‹ะฝ
For that 3rd assignment it will be very helpful if you can share the solution sir.
@richaandparas4285
@richaandparas4285 4 ะฐะน ะฑาฑั€ั‹ะฝ
Assignment 3 solution using list comprehension - dept_lst = [emp[2] for emp in emp_lst] dept_set = set(dept_lst) avg_lst = [[dept, sum([emp[3] for emp in emp_lst if emp[2] == dept])/len([x[2] for x in emp_lst if x[2] == dept])] for dept in dept_set]
@DileepNelliakkattu
@DileepNelliakkattu 3 ะฐะน ะฑาฑั€ั‹ะฝ
This is working perfectly, Thank you
@shivamgupta8106
@shivamgupta8106 4 ะฐะน ะฑาฑั€ั‹ะฝ
Hi Sumit Sir we are saying tuple is immutable but tuple inside list is mutable is that correct. for Ex i/p[(100,5),(200,10)] o/p[(100,5,105),(200,10,220)]
@sekharG-o7m
@sekharG-o7m 6 ะฐะน ะฑาฑั€ั‹ะฝ
could you pls make a video on cicd pipeline, agile methodology
@ameerullah2260
@ameerullah2260 5 ะฐะน ะฑาฑั€ั‹ะฝ
Hello sir, where are you putting notes for viewers? @Sumit Mittal
@sreenivasulareddy-s1w
@sreenivasulareddy-s1w 6 ะฐะน ะฑาฑั€ั‹ะฝ
Hi Sumit sir Are you going to cover data libraries like PANDAS and NUMPY as part of these sessions later ?
@sumitmittal07
@sumitmittal07 6 ะฐะน ะฑาฑั€ั‹ะฝ
yes I will cover
@sreenivasulareddy-s1w
@sreenivasulareddy-s1w 6 ะฐะน ะฑาฑั€ั‹ะฝ
Thank You Sir
@skjahangir3800
@skjahangir3800 6 ะฐะน ะฑาฑั€ั‹ะฝ
@@sumitmittal07 sir when will be the next video on Python
@ameerullah2260
@ameerullah2260 5 ะฐะน ะฑาฑั€ั‹ะฝ
Hello sir, where are you putting notes for viewers?
@sidhantdorge2445
@sidhantdorge2445 6 ะฐะน ะฑาฑั€ั‹ะฝ
Hello Sumit Sir, Just finished watching all the 4 video in your Python playlist, which are super insightful, just wanted to thank you for starting this course (for free) which will be beneficial for every student/employee. I have just finished the assignments that you mentioned at the end of this session, it was quite fun to solve did find the average salary one a bit tough but did not look for solution on GPT and gave it a shot and I am glad that I was able to solve it.๐Ÿ™‚
@sumitmittal07
@sumitmittal07 6 ะฐะน ะฑาฑั€ั‹ะฝ
I am really happy to hear this
@sidhantdorge2445
@sidhantdorge2445 5 ะฐะน ะฑาฑั€ั‹ะฝ
Thank you @@sumitmittal07 Sir. For the assignment solutions I just wanted some of your thoughts and the community so should I share it here?.
@dhanushkumar7849
@dhanushkumar7849 5 ะฐะน ะฑาฑั€ั‹ะฝ
Assignment 2 solution : d=defaultdict(int) for i in trans: status=i[2] d[status]+=1 for a,b in d.items(): print(a,b) Assignment 3 solution : department_salary_sum = defaultdict(int) department_employee_count = defaultdict(int) for _,_,dept,salary in list1: department_salary_sum[dept] += salary department_employee_count[dept] += 1 avg={dept:department_salary_sum[dept]/department_employee_count[dept] for dept in department_salary_sum } for dept, avg_salary in avg.items(): print(f"{dept}: {avg_salary:.2f}")
@sohamchintawar4015
@sohamchintawar4015 4 ะฐะน ะฑาฑั€ั‹ะฝ
Hi Can you please share reference theory material and python files? You mentioned in few videos that its available but I couldn't find it
@shantanuchaudhary1176
@shantanuchaudhary1176 6 ะฐะน ะฑาฑั€ั‹ะฝ
Sir please help with assignment 3
@vishaldeshatwad8690
@vishaldeshatwad8690 6 ะฐะน ะฑาฑั€ั‹ะฝ
Sir How many videos in total does it take to complete the python playlist
@sumitmittal07
@sumitmittal07 5 ะฐะน ะฑาฑั€ั‹ะฝ
total 10 in this playlist
@pramilasekar1975
@pramilasekar1975 5 ะฐะน ะฑาฑั€ั‹ะฝ
Assignement 1: for word in line_set: result_set.append((word,lines.count(word))) print(result_set) for the above code im getting the below code, [('COMPLETE', 4)] [('COMPLETE', 4), ('PENDING_PAYMENT', 3)] [('COMPLETE', 4), ('PENDING_PAYMENT', 3), ('CLOSED', 2)] [('COMPLETE', 4), ('PENDING_PAYMENT', 3), ('CLOSED', 2), ('PROCESSING', 1)] Please let me know how to get the last row alone?
@madhusudank9684
@madhusudank9684 5 ะฐะน ะฑาฑั€ั‹ะฝ
print(result_set) is under for loop. Its an indenting issue. Below updated code will give you the desired result. for word in line_set: result_set.append((word,lines.count(word))) print(result_set)
@Monster4E
@Monster4E 2 ะฐะน ะฑาฑั€ั‹ะฝ
Jo notes save kiye hen wo kdr sy milen gy
@sumitmittal07
@sumitmittal07 ะะน ะฑาฑั€ั‹ะฝ
drive.google.com/drive/folders/1VdJNnlhiXB9G-niCAzY3HADb1ZAL03dp?usp=sharing
@sakshijain3534
@sakshijain3534 6 ะฐะน ะฑาฑั€ั‹ะฝ
someone please share solution of assignment 3 using list comprehension
@gunjansharma3103
@gunjansharma3103 6 ะฐะน ะฑาฑั€ั‹ะฝ
๐Ÿ˜ƒ๐Ÿ˜ƒ
@asktostranger8296
@asktostranger8296 5 ะฐะน ะฑาฑั€ั‹ะฝ
Anyone got notes ???
@asktostranger8296
@asktostranger8296 5 ะฐะน ะฑาฑั€ั‹ะฝ
Anyone got notes please share ๐Ÿ™
@jaykumargupta3647
@jaykumargupta3647 6 ะฐะน ะฑาฑั€ั‹ะฝ
Devin ko sab aata h
@kaladharnaidusompalyam851
@kaladharnaidusompalyam851 6 ะฐะน ะฑาฑั€ั‹ะฝ
๐Ÿ‘๐Ÿ‘๐Ÿซฐ
@sakshijain3534
@sakshijain3534 5 ะฐะน ะฑาฑั€ั‹ะฝ
dep_list=[(1,'JOHN','IT',2000),(2,'sam','IT',2000),(3,'RAM','HR',3000)] dep_list_new= [(line[2],line[3]) for line in dep_list] //[('IT', 2000), ('IT', 2000), ('HR', 3000)] dept_salaries = {} //empty_dict [dept_salaries.setdefault(dept, []).append(salary) for dept, salary in dep_list_new]//{'IT': [2000, 2000], 'HR': [3000]} average_salaries = {dept: sum(salaries) / len(salaries) for dept, salaries in dept_salaries.items()} print(average_salaries)
Master Dictionary Data Structure in Python with Real time Use cases
52:06
Sumit Mittal
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 8 ะœ.
Python Sets with Realtime Usecases | Python by Sumit Sir
43:19
Sumit Mittal
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 5 ะœ.
Je peux le faire
00:13
Daniil le Russe
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 20 ะœะ›ะ
Whoa
01:00
Justin Flom
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 60 ะœะ›ะ
Angry Sigma Dog ๐Ÿคฃ๐Ÿคฃ Aayush #momson #memes #funny #comedy
00:16
ASquare Crew
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 50 ะœะ›ะ
ะคะตะนะบะพะฒั‹ะน ะฒะพั€ะธัˆะบะฐ ๐Ÿ˜‚
00:51
ะšะะ ะ•ะะ ะœะะšะะ ะ•ะะ
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 7 ะœะ›ะ
5 Useful F-String Tricks In Python
10:02
Indently
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 305 ะœ.
10 Python Comprehensions You SHOULD Be Using
21:35
Tech With Tim
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 145 ะœ.
Partitioning vs Bucketing | Interview Question | PySpark #pyspark #bigdata #pwc #interview
12:54
pysparkpulse
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 3,1 ะœ.
Please Master These 10 Python Functionsโ€ฆ
22:17
Tech With Tim
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 156 ะœ.
Python List Comprehensions Made Easy!!
11:50
Travis Media
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 16 ะœ.
List & Tuple - Python Complete Course | Most Important topic In Python
47:33
Sumit Mittal
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 12 ะœ.
Big Data Engineer Mock Interview | Real-time Project Questions | Amount of Data | Cluster Size
25:35
Sumit Mittal
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 4,5 ะœ.
CTE in SQL (Common Table Expression) | SQL WITH Clause | CTE Query Performance | Advanced SQL
55:39
Sumit Mittal
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 102 ะœ.
Azure Data Engineer Mock Interview -First Round
26:57
Azurelib Academy
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 9 ะœ.
10 recently asked Pyspark Interview Questions | Big Data Interview
28:36
Sumit Mittal
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 33 ะœ.
Je peux le faire
00:13
Daniil le Russe
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 20 ะœะ›ะ