A solution to last week’s challenge can be found here.
A bookstore owner would like to analyze why some books were unavailable.
The Dataset reflects the daily slip records of the book available by title, date, and reason why they are or aren’t available. Note that the column “Availability” provides the number of books available for the given date.
For this challenge, help the store owner find out how many consecutive days a book was unavailable and the reason(s) why.
• Start by flagging the day a book is unavailable
• Group by consecutive days of availability by book so you can filter the unavailable books
• Pick the first and last day of unavailability and count the number of consecutive days unavailable and the reasons
• Pull the first and last date of availability
Here's my solution