I have a data frame with Names and departments. All these Names can map to 4 different departments(Department A, B, C, and D). For example, each name has to get mapped to Department A, B, C, D. In the initial data, each name is only mapped to one department. In the final dataset, each name maps to four different departments. I need a way to insert 3 additional rows for each name and also add the 3 other departments for them.
Example:
Initial Data:
Name Department
Joe A
Ellen A
Zach A
Final Data:
Name Department
Joe A
Joe B
Joe C
Joe D
Ellen A
Ellen B
Ellen C
Ellen D
Zach A
Zach B
Zach C
Zach D
I know this can be done in a for loop of some sort but I am very new in Pandas any help will be very much appreciated.