<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Python numpy moving average for data</title>
	<atom:link href="http://argandgahandapandpa.wordpress.com/2011/02/24/python-numpy-moving-average-for-data/feed/" rel="self" type="application/rss+xml" />
	<link>http://argandgahandapandpa.wordpress.com/2011/02/24/python-numpy-moving-average-for-data/</link>
	<description>Another blog with random computer-related musings</description>
	<lastBuildDate>Fri, 06 Apr 2012 10:49:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Simple moving average and the swiss franc &#171; quantathoughts</title>
		<link>http://argandgahandapandpa.wordpress.com/2011/02/24/python-numpy-moving-average-for-data/#comment-644</link>
		<dc:creator><![CDATA[Simple moving average and the swiss franc &#171; quantathoughts]]></dc:creator>
		<pubDate>Sun, 11 Sep 2011 16:37:51 +0000</pubDate>
		<guid isPermaLink="false">http://argandgahandapandpa.wordpress.com/?p=278#comment-644</guid>
		<description><![CDATA[[...] to this post and comments for the [...]]]></description>
		<content:encoded><![CDATA[<p>[...] to this post and comments for the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Haskins</title>
		<link>http://argandgahandapandpa.wordpress.com/2011/02/24/python-numpy-moving-average-for-data/#comment-617</link>
		<dc:creator><![CDATA[Greg Haskins]]></dc:creator>
		<pubDate>Thu, 16 Jun 2011 00:03:25 +0000</pubDate>
		<guid isPermaLink="false">http://argandgahandapandpa.wordpress.com/?p=278#comment-617</guid>
		<description><![CDATA[Nice tip, thanks. I knew there had to be an optimized way for numpy to compute rolling averages.

From the docs (http://docs.scipy.org/doc/numpy/reference/generated/numpy.convolve.html), it looks like your recipe could be even more concise by using the mode=&quot;valid&quot; keyword instead of slicing:

&gt;&gt;&gt; WINDOW = 10
&gt;&gt;&gt; data = [1,2,3,4,5,5,5,5,5,5,5,5,5,5,5]
&gt;&gt;&gt; weightings = numpy.repeat(1.0, WINDOW) / WINDOW
&gt;&gt;&gt; numpy.convolve(data, weightings)[WINDOW-1:-(WINDOW-1)]
array([ 4. ,  4.4,  4.7,  4.9,  5. ,  5. ])
&gt;&gt;&gt; numpy.convolve(data, weightings, &#039;valid&#039;)
array([ 4. ,  4.4,  4.7,  4.9,  5. ,  5. ])]]></description>
		<content:encoded><![CDATA[<p>Nice tip, thanks. I knew there had to be an optimized way for numpy to compute rolling averages.</p>
<p>From the docs (<a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.convolve.html" rel="nofollow">http://docs.scipy.org/doc/numpy/reference/generated/numpy.convolve.html</a>), it looks like your recipe could be even more concise by using the mode=&#8221;valid&#8221; keyword instead of slicing:</p>
<p>&gt;&gt;&gt; WINDOW = 10<br />
&gt;&gt;&gt; data = [1,2,3,4,5,5,5,5,5,5,5,5,5,5,5]<br />
&gt;&gt;&gt; weightings = numpy.repeat(1.0, WINDOW) / WINDOW<br />
&gt;&gt;&gt; numpy.convolve(data, weightings)[WINDOW-1:-(WINDOW-1)]<br />
array([ 4. ,  4.4,  4.7,  4.9,  5. ,  5. ])<br />
&gt;&gt;&gt; numpy.convolve(data, weightings, &#8216;valid&#8217;)<br />
array([ 4. ,  4.4,  4.7,  4.9,  5. ,  5. ])</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anon</title>
		<link>http://argandgahandapandpa.wordpress.com/2011/02/24/python-numpy-moving-average-for-data/#comment-496</link>
		<dc:creator><![CDATA[Anon]]></dc:creator>
		<pubDate>Tue, 26 Apr 2011 18:20:41 +0000</pubDate>
		<guid isPermaLink="false">http://argandgahandapandpa.wordpress.com/?p=278#comment-496</guid>
		<description><![CDATA[Thanks for spotting that! I&#039;ve amended the example.]]></description>
		<content:encoded><![CDATA[<p>Thanks for spotting that! I&#8217;ve amended the example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian</title>
		<link>http://argandgahandapandpa.wordpress.com/2011/02/24/python-numpy-moving-average-for-data/#comment-495</link>
		<dc:creator><![CDATA[Christian]]></dc:creator>
		<pubDate>Tue, 26 Apr 2011 16:47:03 +0000</pubDate>
		<guid isPermaLink="false">http://argandgahandapandpa.wordpress.com/?p=278#comment-495</guid>
		<description><![CDATA[Thanks for the tip, I found it useful!

You have a slight error in your fixed initial value example: &quot;extended_data&quot; should be the one being convolved, not &quot;data&quot;.]]></description>
		<content:encoded><![CDATA[<p>Thanks for the tip, I found it useful!</p>
<p>You have a slight error in your fixed initial value example: &#8220;extended_data&#8221; should be the one being convolved, not &#8220;data&#8221;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
