code: def variance_inflation_factors(df):
      '''
      Computes the variance inflation factor (VIF) for each column in the df.
      Returns a pandas Series of VIFs
  
      Args:
          df: pandas DataFrame with columns to run diagnostics on
      '''
      corr = np.corrcoef(df, rowvar=0)
      corr_inv = np.linalg.inv(corr)
      vifs = np.diagonal(corr_inv)
      return pd.Series(vifs, df.columns, name='VIF'f variance_inflation_factors(df):
      '''
      Computes the variance inflation factor (VIF) for each column in the df.
      Returns a pandas Series of VIFs
  
      Args:
          df: pandas DataFrame with columns to run diagnostics on
      '''
      corr = np.corrcoef(df, rowvar=0)
      corr_inv = np.linalg.inv(corr)
      vifs = np.diagonal(corr_inv)
      return pd.Series(vifs, df.columns, name='VIF')
docs: Computes the variance inflation factor (VIF) for each column in the df.
      Returns a pandas Series of VIFs
  
      Args:
          df: pandas DataFrame with columns to run diagnostics on