code: def dropcols(df, start=None, end=None):
      
  
      if isinstance(df, Series):
          raise ValueError("func only applies to `pd.DataFrame`")
      if start is None:
          start = df.index[0]
      if end is None:
          end = df.index[-1]
      subset = df.index[(df.index >= start) & (df.index <= end)]
      return df.dropna(axis=1, subset=subset)
docs: Drop columns that contain NaN within [start, end] inclusive.
  
      A wrapper around DataFrame.dropna() that builds an easier *subset*
      syntax for tseries-indexed DataFrames.
  
      Parameters
      ----------
      df : DataFrame
      start : str or datetime, default None
          start cutoff date, inclusive
      end : str or datetime, default None
          end cutoff date, inclusive
  
      Example
      -------
      df = DataFrame(np.random.randn(10,3),
                     index=pd.date_range('2017', periods=10))
  
      # Drop in some NaN
      df.set_value('2017-01-04', 0, np.nan)
      df.set_value('2017-01-02', 2, np.nan)
      df.loc['2017-01-05':, 1] = np.nan
  
      # only col2 will be kept--its NaN value falls before `start`
      print(dropcols(df, start='2017-01-03'))
                        2
      2017-01-01  0.12939
      2017-01-02      NaN
      2017-01-03  0.16596
      2017-01-04  1.06442
      2017-01-05 -1.87040
      2017-01-06 -0.17160
      2017-01-07  0.94588
      2017-01-08  1.49246
      2017-01-09  0.02042
      2017-01-10  0.75094