0
from statsmodels.stats.outliers_influence import variance_inflation_factor
vif = pd.DataFrame()
columns = list(telecom.columns)
vif['Columns'] = columns
vif["VIF"] = [variance_inflation_factor(X, i) for i in range(len(columns))]

Telecom is the name of the dataframe TypeError: '(slice(None, None, None), 0)' is an invalid key

  • Hi, welcome on stackoverflow :-)! You should change your tags as it concerns mainly statsmodels and not scikit-learn (and pandas to a small extent). It would be beneficial if we could access your data such that we can reproduce your problem. Have a look to: https://stackoverflow.com/a/20159305/5304366 – Adrien Pacifico Jul 28 '22 at 17:35
  • Please provide enough code so others can better understand or reproduce the problem. – Community Jul 28 '22 at 22:45

0 Answers0