A very late reply, but just in case someone needs a ready function for this:
i.e.
slope, intercept, r_value, p_value, std_err = scipy.stats.linregress(x, y)
as in @Adam Marples’s answer.
More Related Contents:
- Fitting empirical distribution to theoretical ones with Scipy (Python)?
- How to do exponential and logarithmic curve fitting in Python? I found only polynomial fitting
- How to apply piecewise linear fit in Python?
- How do I compute derivative using Numpy?
- How to normalize a NumPy array to a unit vector?
- How do I fit a sine curve to my data with pylab and numpy?
- Compute a confidence interval from sample data
- How to make scipy.interpolate give an extrapolated result beyond the input range?
- Calculating Pearson correlation and significance in Python
- numpy max vs amax vs maximum
- How can I use numpy.correlate to do autocorrelation?
- How to plot empirical cdf (ecdf)
- Linear regression with matplotlib / numpy
- Fitting a line in 3D
- numpy arbitrary precision linear algebra
- scipy curve_fit doesn’t like math module
- Efficiently detect sign-changes in python
- Pythonic way of detecting outliers in one dimensional observation data
- fitting data with numpy
- How to calculate the statistics “t-test” with numpy
- Linear regression of arrays containing NANs in Python/Numpy
- Fitting a closed curve to a set of points
- How to calculate cumulative normal distribution?
- NumPy: Logarithm with base n
- Equivalent of `polyfit` for a 2D polynomial in Python
- Multivariate polynomial regression with numpy
- Compute a confidence interval from sample data assuming unknown distribution
- Interpolating a closed curve using scipy
- Why is numpy.prod() incorrectly returning negative results, or 0, for my long lists of natural numbers?
- Computing cross-correlation function?