I have a dataframe containing name of companies and people. For instance, in the same row, in the first column I have the name of the company and in its second column I have the people's names that are part of the company (each line a name). And the number of people varies for each company and I have more than 100 companies.
This is a sample of the dataset:
Company name DM Full name
LA CAMPAGNOLA SA Mr Victor Daniel Martin
Mr Fernando Luis Falco
Mr Gustavo Pablo Macchi
Mr Marcelo Dario Siano
INVERSORA ELECTRICA S.A. Mr Luis Pablo Rogelio Pagano
Mr Damian Eduardo Sanfilippo
Mr Sebastian Cordova Moyano
Ms Sylvina Gabriela Sanchez
Mr Luis Rodolfo Secco
Mr Jaime Javier Barba
What I need is to create a new dataframe where each row is an independent item that includes the name of the company and the name of the employee as follows:
Company name DM Full name
LA CAMPAGNOLA SA Victor Daniel Martin
LA CAMPAGNOLA SA Fernando Luis Falco
LA CAMPAGNOLA SA Gustavo Pablo Macchi
LA CAMPAGNOLA SA Marcelo Dario Siano
INVERSORA ELECTRICA S.A. Luis Pablo Rogelio Pagano
INVERSORA ELECTRICA S.A. Damian Eduardo Sanfilippo
INVERSORA ELECTRICA S.A. Sebastian Cordova Moyano
INVERSORA ELECTRICA S.A. Sylvina Gabriela Sanchez
INVERSORA ELECTRICA S.A. Luis Rodolfo Secco
INVERSORA ELECTRICA S.A. Jaime Javier Barba
I've found different examples as ways to do it, but none of them work. For instance: Split cell into multiple rows in pandas dataframe
Can somebody give me a hand on how to do it?