'ValueError: The indices for endog and exog are not aligned in OLS

I am using a scaler and OLS regression but I get this error: "The indices for endog and exog are not aligned"

x=data.drop('Acceptance', 1)
y=data['Acceptance']

from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
x_std= scaler.fit_transform(x)
x_std= pd.DataFrame(x_std)

import statsmodels.api as sm
model = sm.OLS(x_std, y)
results = model.fit()
print(results.summary())


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source