(self)
Prepare the holidays data frame.
        The request should contain a holiday column which provides the holidays for past and future dates.
        The column provides holiday names, while the ds column provides the holiday's date. 
        Rows without a holiday name are considered non-holidays and not part of the holiday data frame.
Prepare the holidays data frame.
        The request should contain a holiday column which provides the holidays for past and future dates.
        The column provides holiday names, while the ds column provides the holiday's date. 
        Rows without a holiday name are considered non-holidays and not part of the holiday data frame.
Prepare the holidays data frame . The request should contain a holiday column which provides the holidays for past and future dates . The column provides holiday names while the ds column provides the holiday s date . Rows without a holiday name are considered non - holidays and not part of the holiday data frame .
def _prep_holidays(self):
        """
        Prepare the holidays data frame.
        The request should contain a holiday column which provides the holidays for past and future dates.
        The column provides holiday names, while the ds column provides the holiday's date. 
        Rows without a holiday name are considered non-holidays and not part of the holiday data frame.
        """

        # Create a holidays data frame
        self.holidays_df = pd.DataFrame([(row.duals[0].numData, row.duals[2].strData)\
                                            for request_rows in self.request\
                                            for row in request_rows.rows],\
                                        columns=['ds','holiday'])
        
        # Add upper and lower window for the holidays if applicable
        if self.lower_window is not None:
            self.holidays_df.loc[:, 'lower_window'] = self.lower_window
        if self.upper_window is not None:
            self.holidays_df.loc[:, 'upper_window'] = self.upper_window
                
        # Copy dates from the request_df
        self.holidays_df.loc[:,'ds'] = self.request_df.loc[:,'ds'].copy()
        
        # Remove rows from the holidays data frame where the holiday or ds column is empty
        self.holidays_df = self.holidays_df.loc[self.holidays_df.holiday != '']
        self.holidays_df = self.holidays_df.loc[self.holidays_df.ds.notnull()]

        # If the holidays data frame is empty we don't need to add it to the key word arguments for prophet
        if self.holidays_df.empty:
            self.has_holidays = False
            return
        
        # Make the holidays names lower case to avoid the return argument becoming case sensitive
        self.holidays_df.loc[:,'holiday'] = self.holidays_df.holiday.str.lower()
        # Also remove spaces and apostrophes
        self.holidays_df.loc[:,'holiday'] = self.holidays_df.holiday.str.replace(" ", "_")
        self.holidays_df.loc[:,'holiday'] = self.holidays_df.holiday.str.replace("'", "")
        
        # Sort by the ds column and reset indexes
        self.holidays_df = self.holidays_df.sort_values('ds').reset_index(drop=True)
        
        # Finally add this to the key word argumemnts for Prophet
        self.prophet_kwargs['holidays'] = self.holidays_df
def _prep_holidays ( self ) : # Create a holidays data frame self . holidays_df = pd . DataFrame ( [ ( row . duals [ 0 ] . numData , row . duals [ 2 ] . strData ) for request_rows in self . request for row in request_rows . rows ] , columns = [ 'ds' , 'holiday' ] ) # Add upper and lower window for the holidays if applicable if self . lower_window is not None : self . holidays_df . loc [ : , 'lower_window' ] = self . lower_window if self . upper_window is not None : self . holidays_df . loc [ : , 'upper_window' ] = self . upper_window # Copy dates from the request_df self . holidays_df . loc [ : , 'ds' ] = self . request_df . loc [ : , 'ds' ] . copy ( ) # Remove rows from the holidays data frame where the holiday or ds column is empty self . holidays_df = self . holidays_df . loc [ self . holidays_df . holiday != '' ] self . holidays_df = self . holidays_df . loc [ self . holidays_df . ds . notnull ( ) ] # If the holidays data frame is empty we don't need to add it to the key word arguments for prophet if self . holidays_df . empty : self . has_holidays = False return # Make the holidays names lower case to avoid the return argument becoming case sensitive self . holidays_df . loc [ : , 'holiday' ] = self . holidays_df . holiday . str . lower ( ) # Also remove spaces and apostrophes self . holidays_df . loc [ : , 'holiday' ] = self . holidays_df . holiday . str . replace ( " " , "_" ) self . holidays_df . loc [ : , 'holiday' ] = self . holidays_df . holiday . str . replace ( "'" , "" ) # Sort by the ds column and reset indexes self . holidays_df = self . holidays_df . sort_values ( 'ds' ) . reset_index ( drop = True ) # Finally add this to the key word argumemnts for Prophet self . prophet_kwargs [ 'holidays' ] = self . holidays_df