How to add missing rows to data frame based on few columns in python?

Viewed 16

I have a data frame that looks like this:df_input

So for every name, every date, every class I want to extend h to 5 and fill P column with nan values, so the output would look like this:df_output I did this with for loops, but I would rather do it without it, is there simpler way and more elegant?

0 Answers
Related