code: def asfreq(self, freq):
          
          frame = self.frame
          if freq == 'B':
              resampled = frame.groupby(frame.index.date).apply(lambda f: f.sum())
              resampled.index = pd.DatetimeIndex([i for i in resampled.index])
              return ProfitAndLossDetails(resampled)
          else:
              resampled = frame.resample(freq, how='sum')
              return ProfitAndLossDetails(resampled)
docs: Resample the p&l at the specified frequency
  
          :param freq:
          :return: Pl object