Amazon Python Interview Question for a Data Engineer L4 Position | Python For Data Analytics

  Рет қаралды 15,725

Ankit Bansal

Ankit Bansal

5 ай бұрын

In this video we are going to discuss a Python Interview problem asked in Amazon for a data engineer Position.
Here is the input list:
emp_list=[('Ankit',10000),('Rahul',12000),('Sumit',14000),('Dheeraj',21000),('Pavan',11000),('Mohit',13000)]
Expected Output: [('Sumit',14000),('Dheeraj',21000)]
Zero to hero(Advance) SQL Aggregation:
• All About SQL Aggregat...
Most Asked Join Based Interview Question:
• Most Asked SQL JOIN ba...
Solving 4 Trick SQL problems:
• Solving 4 Tricky SQL P...
Data Analyst Spotify Case Study:
• Data Analyst Spotify C...
Top 10 SQL interview Questions:
• Top 10 SQL interview Q...
Interview Question based on FULL OUTER JOIN:
• SQL Interview Question...
Playlist to master SQL :
• Complex SQL Questions ...
Rank, Dense_Rank and Row_Number:
• RANK, DENSE_RANK, ROW_...
#python #dataengineer

Пікірлер: 67
@user-ho7kx2qr5y
@user-ho7kx2qr5y 5 ай бұрын
Thank you so much Ankit for making video on data validation using Python 🙏🏻❤
@ankitbansal6
@ankitbansal6 5 ай бұрын
My pleasure😊
@ankitbansal6
@ankitbansal6 5 ай бұрын
Do give a thumbs up to the video for more Python Interview Questions😊
@baskarandurai6702
@baskarandurai6702 5 ай бұрын
Kindly continue this python series Ankit... Kind request from one of your fan.. ❤❤❤
@aoihana1042
@aoihana1042 5 ай бұрын
To show off python skills: avg = sum(emp[1] for emp in emp_list)/len(emp_list) result= list(filter (lambda x: x[1]>avg, emp_list)) print(result)
@prabhatgupta6415
@prabhatgupta6415 5 ай бұрын
avg_salary=sum(i[1]for i in emp_list)/len(emp_list) print([i for i in emp_list if i[1]>avg_salary])
@pankajrao6895
@pankajrao6895 5 ай бұрын
we want more python videos ankit , keep em coming
@ankitbansal6
@ankitbansal6 5 ай бұрын
100 percent 😊
@sprinter5901
@sprinter5901 5 ай бұрын
Alternative solution using pandas emp_list = [('Ankit', 10000), ('Rahul', 12000), ('Sumit', 14000), ('Dheeraj', 21000), ('Pavan', 11000), ('Mohit', 13000)] df = pd.DataFrame(emp_list, columns=['emp_name', 'Salary']) average_salary = df['Salary'].mean() df[df['Salary'] > average_salary]
@ramakumarguntamadugu1299
@ramakumarguntamadugu1299 27 күн бұрын
Please continue posting similar python videos as well👍👍
@balabhadrakotesh4064
@balabhadrakotesh4064 5 ай бұрын
My Solution: emp_list=[('Ankit',10000),('Rahul',12000),('Sumit',14000),('Dheeraj',21000),('Pavan',11000),('Mohit',13000)] avg_sal = sum([second for first,second in emp_list])/len(emp_list) print([emp for emp in emp_list if emp[1] > avg_sal])
@pranjalwaghmare3846
@pranjalwaghmare3846 5 ай бұрын
Thank you Ankit for making such practical videos on Python 🙏🙏🙏 Eagerly waiting for more such videos!!
@adityatomar9820
@adityatomar9820 5 ай бұрын
I reallly needed this series sir, THANKYOU
@harshitbhadoria2393
@harshitbhadoria2393 5 ай бұрын
Sir Today I saw your first video, how easily you explained every concept, thank you so much sir :)
@nidhigupta7606
@nidhigupta7606 5 ай бұрын
Thanks @ankit looking forward to more such examples.
@sapnanimbalkar1210
@sapnanimbalkar1210 5 ай бұрын
Thanks Ankit for Python🐍 Content as well. Needed the most 🍀
@dianasatapathy594
@dianasatapathy594 Ай бұрын
Your sql videos have helped us a lot in our career. Please make more videos in python as well:)
@Data.scientistt
@Data.scientistt 5 ай бұрын
def avg_sal(emp_list): avg_sal = sum(i[1] for i in emp_list)/ len(emp_list) return [x for x in emp_list if x[1] > avg_sal]
@shailendra9292
@shailendra9292 5 ай бұрын
import numpy as np avg_sal = np.mean([x[1] for x in emp_list]) print([x for x in emp_list if x[1] > avg_sal])
@Tusharchitrakar
@Tusharchitrakar 5 ай бұрын
This is much better since numpy is more efficient due to vectorization
@avi8016
@avi8016 5 ай бұрын
Great initiative 💯 This will help us a lot, thankyou so much 🙏
@ankitbansal6
@ankitbansal6 5 ай бұрын
My pleasure 😊
@dikshantchaudhary3014
@dikshantchaudhary3014 5 ай бұрын
We need more videos on python question . Thanks!
@the_realkumar
@the_realkumar 5 ай бұрын
Very informative , very much demanding video, bro please bring everyday it's very helpful...❤❤❤
@ankitbansal6
@ankitbansal6 5 ай бұрын
Thank you, I will
@rk-ej9ep
@rk-ej9ep 5 ай бұрын
This is nice..👍👍
@zainaltaf4935
@zainaltaf4935 5 ай бұрын
its a good video ankit
@tharanga835
@tharanga835 5 ай бұрын
Now i can solve complex sql question after doing your sql video series, but I am missing python, Please do python interview question, thank you sir for your effort and time
@saipriya2682
@saipriya2682 5 ай бұрын
Thank you, its really helpfull.
@ankitbansal6
@ankitbansal6 5 ай бұрын
You're welcome!
@DineshGudla
@DineshGudla 5 ай бұрын
@ankit bansal it is a great way to learn basics
@karankakkar9020
@karankakkar9020 4 ай бұрын
Thanks Ankit..❤ please start python interview question series
@dattatraysuryawanshi934
@dattatraysuryawanshi934 5 ай бұрын
We want more video like this. If may I request, you can type in notebook comments the python concept used to solve probelm. Like in this problem concept used is tuple unpacking..
@nipunshetty9640
@nipunshetty9640 5 ай бұрын
Man What a Head you Have Ankit genius😁🙌👌
@vikramjitsingh6769
@vikramjitsingh6769 5 ай бұрын
Python series would be great Ankit...
@adityamohapatra9530
@adityamohapatra9530 5 ай бұрын
Created a dataframe and stored the value of the list and then using the pandas dataframe manipulation to filter the names of the employees salary greater than average.
@SumithDommati
@SumithDommati 2 ай бұрын
emp_list = [('Ankit', 10000), ('Rahul', 12000), ('Sumit', 14000), ('Dheeraj', 21000), ('Pavan', 11000), ('Mohit', 13000)] total_salary=0 for name,salary in emp_list: total_salary+=salary avg=total_salary/len(emp_list) print(avg) print([(name,salary) for name, salary in emp_list if salary > avg])
@raviyadav-dt1tb
@raviyadav-dt1tb 5 ай бұрын
Please do more videos 🙏
@xiamojq621
@xiamojq621 5 ай бұрын
Please can you upload video on implementation of statistical concept using python
@sanketgilbile2427
@sanketgilbile2427 5 ай бұрын
This is so easy
@zebakauser7178
@zebakauser7178 5 ай бұрын
My solution: ▪List comprehension to extract salaries. emp_salary = [salary for name, salary in emp_list] ▪Calculate average salary avg_salary = sum(emp_salary) / len(emp_salary) ▪List comprehension to filter employees whose salary is greater than the average salary expected = [(name, salary) for name, salary in emp_list if salary > avg_salary] ▪print(expected) [('Sumit', 14000), ('Dheeraj', 21000)]
@saib7231
@saib7231 5 ай бұрын
Convert the data into data frame Df=pd.dataframe(data) df['avg'] = df['salary'].mean() filtered_df = df[df['salary'] > df['avg']]
@MoHz-rx5my
@MoHz-rx5my 5 ай бұрын
I think Pandas are not allowed by interviewer
@lol000333
@lol000333 5 ай бұрын
Thanks for explaining but you should have covered list comprehension in the same video as well so that everyone will get all the flavor Sol : import numpy as np final_list = [val for val in emp_list if val[1] > np.mean([val[1] for val in emp_list])]
@ankitbansal6
@ankitbansal6 5 ай бұрын
Good point.
@jjayeshpawar
@jjayeshpawar 5 ай бұрын
avg_sal=((sum([i[1] for i in emp_list]))/len(emp_list)) print([i for i in emp_list if i[1]>=avg_sal])
@gazart8557
@gazart8557 4 ай бұрын
Plz do more python plz plz
@vishnupsharma50
@vishnupsharma50 3 ай бұрын
emp_name= [tuple[0] for tuple in emp_list if tuple[1]>=np.mean([val[1] for val in emp_list])]
@atifsuhail7803
@atifsuhail7803 5 ай бұрын
data=[ ('Ankit',10000),('Rahul',12000),('Sumit',14000),('Dheraj',21000),('Pavan',11000),('Mohit',13000)] print(data) avg_sal=sum(sal for _, sal in data)/len(data) output=[i for i in data if i[-1]>avg_sal] print(output)
@Tiger_Gaming30
@Tiger_Gaming30 5 ай бұрын
How can we append multiple dictionaries with same key but different values in empty list of dictionary dynamically
@adharshsunny5154
@adharshsunny5154 5 ай бұрын
Bro please start AWS training
@-es2bf
@-es2bf 2 ай бұрын
why do we use python when we have SQL? I have mainly used pandas just for pivot tables, since making a pivot table in sql is not that convenient. Most of them time when I am working with a df in a jupyter notebook instead of a table in a database I just google how to do this in python the way I would have done it in sql. Okay of course if you need to connect to an api and scrape a bit, it is useful but besides that why do we need it for simple filtering?
@DEwithDhairy
@DEwithDhairy 5 ай бұрын
DSA for the Data Engineer / Data Analyst or Data Science ROle : kzfaq.info/sun/PLqGLh1jt697wQTamFvXx_Odlm-Wg3zbxq&si=6owKBIz4xO93BxPN
@vamsisai6830
@vamsisai6830 5 ай бұрын
can you please start a dedicated bootcamp on this please
@ankitbansal6
@ankitbansal6 5 ай бұрын
It's already going on
@tequilajoe518
@tequilajoe518 5 ай бұрын
@@ankitbansal6 Pls send link to register
@gurjotesinghsandhu638
@gurjotesinghsandhu638 5 ай бұрын
this is normal lite life, use list comprehensions for mentos pro max
@ankitbansal6
@ankitbansal6 5 ай бұрын
Sure
@chaitalibanerjee5459
@chaitalibanerjee5459 5 ай бұрын
Sir when you are going to again start SQL course
@ankitbansal6
@ankitbansal6 5 ай бұрын
March
@localmartian9047
@localmartian9047 5 ай бұрын
Isn't this too easy for Amazon. How can we do this looping once
@ankitbansal6
@ankitbansal6 5 ай бұрын
It's for L4 position. So its fine.
@sasmitanayak1346
@sasmitanayak1346 5 ай бұрын
using list comprehension: emp_list = [('Ankit', 10000), ('Rahul', 12000), ('Sumit', 14000), ('Dheeraj', 21000), ('Pavan', 11000), ('Mohit', 13000)] avg_sal = sum(salary for name, salary in emp_list) / len(emp_list) my_list = [(name, salary) for name, salary in emp_list if salary > avg_sal] print(my_list)
@shashwatshekhar6867
@shashwatshekhar6867 5 ай бұрын
def final_required_output_calc(emp_list): sum_of_salary=0 for i in range(len(emp_list)): sum_of_salary=sum_of_salary+emp_list[i][1] average_salary=sum_of_salary/len(emp_list) final_list=[] for i in range(len(emp_list)): if emp_list[i][1]>average_salary: final_list.append(emp_list[i]) return final_list Edit:Saw your solution it is almost same 😂
@satvikjha2019
@satvikjha2019 5 ай бұрын
More easy code with Pandas. import pandas as pd emp_list=[('Ankit',10000),('Rahul',12000),('Sumit',14000),('Dheeraj',21000),('Pavan',11000),('Mohit',13000)] #Unpacking Tuples for creating DataFrame EMP = [] Sal = [] for name,salary in emp_list: EMP.append(name) Sal.append(salary) #Creating DataFrame and renaming the columns and putting the condition emp_df = pd.DataFrame({'name':EMP,'Salary':Sal}) emp_df[emp_df["Salary"] > emp_df["Salary"].mean()]
@anandahs6078
@anandahs6078 2 ай бұрын
emp_list = [('Ankit', 10000), ('Rahul', 12000), ('Sumit', 14000), ('Dheeraj', 21000), ('Pavan', 11000), ('Mohit', 13000)] emp_dict = dict(emp_list) avg = sum(emp_dict.values()) / len(emp_dict) print(f"average salary:{avg}") employee_avg_list = [(key, value) for key, value in emp_dict.items() if value > avg] print(employee_avg_list)
@chethan4160
@chethan4160 5 ай бұрын
my code def get_avg_sal(tup_list): total = sum(sal for _, sal in tup_list) # Calculate the total salary using a generator expression return total / len(tup_list) def get_name(tup_list, avg_sal): return [(name, sal) for name, sal in tup_list if sal > avg_sal] avg_sal = get_avg_sal(tup_list) my_list = get_name(tup_list, avg_sal) print(my_list)
🤔Какой Орган самый длинный ? #shorts
00:42
ТАМАЕВ УНИЧТОЖИЛ CLS ВЕНГАЛБИ! Конфликт с Ахмедом?!
25:37
THE POLICE TAKES ME! feat @PANDAGIRLOFFICIAL #shorts
00:31
PANDA BOI
Рет қаралды 25 МЛН
How I Use Python as a Data Engineer
9:08
Darshil Parmar
Рет қаралды 72 М.
PWC Data Analyst Interview | SQL Intermediate Question 11
9:46
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 620 М.
How I'd Learn to be a Data Analyst in 2024
13:17
Luke Barousse
Рет қаралды 251 М.
🤔Какой Орган самый длинный ? #shorts
00:42