code: def front_and_backfill(self, cols, inplace=True):
          
          cols = list(cols)
          for col in cols:
              if col not in self.df.columns: self.df[col] = np.nan
          short_df = self.df[cols]
          # horrible, bizarre hack to test for pandas malfunction
          tester = short_df.groupby(short_df.index, sort=False).fillna(method='ffill')
          if not_null(tester):
              short_df = short_df.groupby(short_df.index, sort=False).fillna(method='ffill').groupby(short_df.index, sort=False).fillna(method='bfill')
          else:
              print('-W- Was not able to front/back fill table {} with these columns: {}'.format(self.dtype, ', '.join(cols)))
          if inplace:
              self.df[cols] = short_df[cols]
              return self.df
          return short_df
docs: Groups dataframe by index name then replaces null values in selected
          columns with front/backfilled values if available.
          Changes self.df inplace.
  
          Parameters
          ----------
          self : MagicDataFrame
          cols : array-like
              list of column names
  
          Returns
          ---------
          self.df