I have a list of objects by each name and a dataframe like this.
Jimmy = ['chair','table','pencil']
Charles = ['smartphone','cake']
John = ['clock','paper']
| id | name |
|---|---|
| 1 | Jimmy |
| 2 | Charles |
| 3 | John |
I would like to use a loop that allows me to obtain the following result.
| id | name | picks |
|---|---|---|
| 1 | Jimmy | chair |
| 1 | Jimmy | table |
| 1 | Jimmy | pencil |
| 2 | Charles | smartphone |
| 2 | Charles | cake |
| 3 | John | clock |
| 3 | John | paper |
source https://stackoverflow.com/questions/73326379/how-to-add-multiple-values-and-make-the-row-repeat-for-the-number-of-values
Comments
Post a Comment