I deleted my original answer as it was poor. Sorry for the confusion.
I created your data here as a dataframe. In the future, it is nice when you ask questions to provide the first 3 lines of code below.