Re: [Matplotlib-users] linear regression with dates as x axis

2012-06-13 Thread pybokeh
Sorry looks like my smartphone's copy/paste removed carriage return in certain places in the script :-( On Jun 13, 2012 12:32 PM, "Chris Withers" wrote: > Hi all, > > I have some time series of disk usage that I'd like to do a linear > regression on an plot on a nice graph with Mb used on the y-a

Re: [Matplotlib-users] linear regression with dates as x axis

2012-06-13 Thread pybokeh
Check out linregress from scipy.stats module. Not sure if it will handle dates. Sample script below: from scipy.stats import pearsonr from scipy.stats import linregress from matplotlib import pyplot as plt import numpy as np sat = np.array([595,520,715,405,680,490,565]) gpa = np.array([3.4,3.2,

[Matplotlib-users] linear regression with dates as x axis

2012-06-13 Thread Chris Withers
Hi all, I have some time series of disk usage that I'd like to do a linear regression on an plot on a nice graph with Mb used on the y-axis and date on the x axis. I tried to use pylab.polyfit(dates, usage) where: dates = [datetime(x, y, z), datetime(a, b, c), ...] usage = [12123234, 223423523