Hi,<br><br>I assume you have this data in a txt file, correct? You can load up all of it in a numpy array using<br>import numpy as np<br>data = np.loadtxt("climat_file.txt", skiprows = 1)<br><br>Then you can compute the mean you want by taking it on a slice of the data array. For example, if you want to compute the mean of your data in Jan for 1950-1970 (say including 1970)<br>
mean1950_1970 = data[1950:1971,1].mean()<br><br>Then the std deviation you want could be computed using<br>my_std = np.sqrt(np.mean((data[:,1]-mean1950_1970)**2))<br><br>Hope this helps,<br>Jonathan <br><br><div class="gmail_quote">
On Tue, Apr 12, 2011 at 1:48 PM, Climate Research <span dir="ltr"><<a href="mailto:climateforu@gmail.com">climateforu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi <br>I am purely new to python and numpy.. I am using python for doing statistical calculations to Climate data..<br><br>I have a data set in the following format..<br><br>Year Jan feb Mar Apr................. Dec<br>
1900 1000 1001 , , ,<br>1901 1011 1012 , , ,<br>1902 1009 1007 , ,<br>,,,, , ' , , ,<br>
,,,, , ,<br>2010 1008 1002 , , ,<br><br>I actually want to standardize each of these values with corresponding standard deviations for each monthly data column..<br>
I have found out the standard deviations for each column.. but now i need to find the standared deviation only for a prescribed mean value<br>ie, when i am finding the standared deviation for the January data column.. the mean should be calculated only for the january data, say from 1950-1970. With this mean i want to calculate the SD for entire column.<br>
Any help will be appreciated..<br><br><br>
<br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Jonathan Rocher, PhD<br><span style="color: rgb(102, 102, 102);">Scientific software developer</span><br><font color="#888888"><span>Enthought</span>, Inc.<br>
<a href="mailto:jrocher@enthought.com" target="_blank">jrocher@<span>enthought</span>.com</a><br>
1-512-536-1057<br>
<a href="http://www.enthought.com/" target="_blank">http://www.<span>enthought</span>.com</a></font><br><div style="display: inline;"></div><br>