0

I have a df that has a column per employee per month. Let's say we're looking at salary data. So we have three columns employee_id, month_year, base_salary. And let's say we only have three months: Jan 2022, Feb 2022, March 2022.

I want to transform this dataset to have the following columns instead: employee_id, base_salary_jan_2022, base_salary_feb_2022, base_salary_mar_22.

How would I do this in pandas/python?

ZDR
  • 47
  • 5

0 Answers0