I have 2 csv file. They have one common column which is ID. What I want to do is I want to extract the common rows and built another dataframe. Firstly, I want to select job, and after that, as I said they have one common column, I want to find the rows whose IDs are the same. Visually, the dataframe should be seen like this:
Let first DataFrame is:
#ID | #Gender | #Job | #Shift | #Wage |
---|---|---|---|---|
1 | Male | Engineer | Night | 8000 |
2 | Male | Engineer | Night | 7865 |
3 | Female | Worker | Day | 5870 |
4 | Male | Accountant | Day | 5870 |
5 | Female | Architecture | Day | 4900 |
Let second one is:
#ID | #Department |
---|---|
1 | IT |
2 | Quality Control |
5 | Construction |
7 | Construction |
8 | Human Resources |
And the new DataFrame should be like:
#ID | #Department | #Job | #Wage |
---|---|---|---|
1 | IT | Engineer | 8000 |
2 | Quality Control | Engineer | 7865 |
5 | Construction | Architecture | 4900 |