Let's consider the dataframe below -
df = pd.DataFrame({"names": ["foo", "boo", "coo","coo"],"time": [1,4,2,3],"values": [20,10,15,12]})
I want to insert rows for all possible time between 1 and maximum of time column for each name. So the desired dataframe would be -
df = pd.DataFrame({"names": ["foo","boo","boo", "boo","boo","coo","coo","coo"],"time": [1,1,2,3,4,1,2,3],"values": [20,NaN,NaN,NaN,10,NaN,15,12]})
How to do it?