I have a dataframe with two colums of interest: a column with names (repeated for each course), and a column with the course name they've taken or started. The problem is, if I use the dataframe as-is, if a person has not attempted the course, they won't have a value showing for that course at all, and therefore I won't be able to tell who is missing the course. Is there a way to auto generate the missing rows with a name? The other columns can be N/A or anything else.
Dataframe:
| Name | Course Title | Completion Date |
|---|---|---|
| Mark | Math | 1/1/2021 |
| Mark | English | 2/1/2021 |
| Mark | Econ | 3/1/2021 |
| David | Math | 7/1/2021 |
| David | English | 4/1/2021 |
| Cindy | Math | 6/1/2021 |
| Cindy | English | 9/1/2021 |
| Cindy | Econ | 11/1/2021 |
What I'm looking for:
| Name | Course Title | Completion Date |
|---|---|---|
| Mark | Math | 1/1/2021 |
| Mark | English | 2/1/2021 |
| Mark | Econ | 3/1/2021 |
| David | Math | 7/1/2021 |
| David | English | 4/1/2021 |
| David | Econ | N/A |
| Cindy | Math | 6/1/2021 |
| Cindy | English | 9/1/2021 |
| Cindy | Econ | 11/1/2021 |