47442/python-script-for-linear-regression-on-panda-dataframe
I have the following panda dataframe: value 0 4354 1 7556 2 609 3 7842 I need to perform linear regression on it. Can I have a python script for this purpose? Thank you
Transform Your Career with AI, Enroll now in AI for Startup certification today!
Use the following code:
from scipy import stats slope, intercept, r_value, p_value, std_err = stats.linregress(df.index, df['value']) df['linreg'] = intercept + slope * df.index
Yes, you can do this using statsmodels: import ...READ MORE
The above situation is the case where ...READ MORE
Evaluation of Variance: variance = np.var(prediction) # Where ...READ MORE
Apart from instructional purposes, I'm not sure ...READ MORE
Hey @Vivek, Try something like this: >>> from ...READ MORE
You can read excel files df = pd.read_excel(...) You ...READ MORE
Few real-world applications of machine learning are Have ...READ MORE
Hi @Dipti, you could try something like ...READ MORE
Rolling regression is the analysis of changing ...READ MORE
Have a look at this one, It's ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.