Price Elasticity, Price Optimization, Price Analysis, Python, Regression.
Fig 4. Non-linear Price Elasticity Function import statsmodels.api as sm from statsmodels.tools.tools import add_constant import numpy as np x_value = np.log(df['Price']) y_value = np.log(df['Quantity']) X = add_constant(x_value) model = sm.OLS(y_value, X) result = model.fit()