Pandas Commonly Asked Interview Question | Window Functions in Pandas | Python for Data Analysis

preview_player
Показать описание
In this video we are going to understand how to create window functions in pandas just like in SQL. We will also solve a interview question.

Zero to hero(Advance) SQL Aggregation:

Most Asked Join Based Interview Question:

Solving 4 Trick SQL problems:

Data Analyst Spotify Case Study:

Top 10 SQL interview Questions:

Interview Question based on FULL OUTER JOIN:

Playlist to master SQL :

Rank, Dense_Rank and Row_Number:

script:
create table emp(
emp_id int,
emp_name varchar(20),
department_id int,
salary int,
manager_id int,
emp_age int);

insert into emp
values
(1, 'Ankit', 100,10000, 4, 39;
insert into emp
values (2, 'Mohit', 100, 15000, 5, 48);
insert into emp
values (3, 'Vikas', 100, 12000,4,37);
insert into emp
values (4, 'Rohit', 100, 14000, 2, 16);
insert into emp
values (5, 'Mudit', 200, 20000, 6,55);
insert into emp
values (6, 'Agam', 200, 12000,2, 14);
insert into emp
values (7, 'Sanjay', 200, 9000, 2,13);
insert into emp
values (8, 'Ashish', 200,5000,2,12);
insert into emp
values (9, 'Mukesh',300,6000,6,51);
insert into emp
values (10, 'Rakesh',500,7000,6,50);

#pandas #dataengineer #python #dataanalysis
Рекомендации по теме
Комментарии
Автор

Hi Ankit, Few months ago I was searching for any blog or video that teaches pandas operations for a SQL guy. Couldn't find anything useful hence ended up browsing through the web and learning concept by concept and relating to SQL by myself. Your effort here to teach pandas through SQL concepts is much appreciated. Please keep up the good work.

clear_vision_
Автор

Hi Ankit,
Could you please explain how can we use dense_rank in pandas as this approach shown will not work if we have similar salaries?

abhishekjain
Автор

Please continue to make videos on pandas. I benefited very much from your SQL videos.

spideymoin
Автор

Hi Ankit, can you help me in solving this question using pandas:

1. How can we find the 3rd highest salary in general ( considering the case we have same salary as well in Dataframe)?

2. How can we find the 3rd highest salary if there are same salaries present in each department?


These cumcount() doesn't work in that case.

In sql, we can just use dense_rank but how can we achieve using Pandas?

theraizadatalks
Автор

Most useful and informative video.
Thanks Sir, for making a video on request.
Very nice explanation. Need more videos on pandas windows function

akshitsinghal
Автор

Thank you so much, please continue to create more videos on Python. Thank you

birappagoudanavar
Автор

please make a video to handle null values using pandas

enjoyfriends
Автор

why did we first sorted the values and then do group by, it should be group by followed by sort. Please correct me here.
or the sequence will not matter in pandas.

2. How does cumcount() is working here? if someone can please explain it.


Thanks a lot for such insightful videos, its really helpful because in other channel or sources we get to know only the basics of these packages bt not how to use them to solve complex questions.
Thanks again.

mdy
Автор

Thank you so much Ankit, really appreciate your effort in putting this together. 😇

sharu
Автор

Very helpful lecture . Thanks for the efforts

nishitnishikant
Автор

How to perform dense_rank( ) incase if we have 2 records with same salary for 3rd highest salary?
cumcount()+1 doesn't seems to work quiet rite in that case. Thanks!

shorakhutte
Автор

What if We do groupby first and then SortValues, will it make any difference ?

jay_rana
Автор

Could you also make videos solving product metrics using pandas

rose
Автор

Hi Ankit...Thanks for the content...I have a query why on using sort values after grouping on Department id throws an error?

mohdtoufique
Автор

Nice one. Could you also put video's related to handling of string functions (like substring) practice exercises in SQL.

vigneshnagaraj
Автор

Sir, can take more videos on python for data engineer

anujraut
Автор

Really information videos Ankit Ji.
Kindly please create videos on data ingestion using python of data pipeline.
Thanks,
Fahad

delhilife
Автор

@Ankit bansal i have an Doubt. In the Data Engineering Interview Interviewer ask Python Programming Questions or Library Related Questions (Like Numpy and Pandas)?

soumyaranjandash
Автор

Can you make videos for Homogeneous and heterogenous validations by using python data frames?

prakashkrishnan
Автор

Sir please make video on roadmap of data engineer

chandrakantpatil