Is there an efficient in python without using for loops, to create the following output? I have a dataframe including multiple items, dates and quantities and a specif