# HG changeset patch # User Shantanu # Date 1270931219 -19800 # Node ID f248e91b1510579a6e8748a36484b7399fc96a12 # Parent c2634d874e335748f6947be32b27f3cd589112e9 Added changes to 3.1 session script. diff -r c2634d874e33 -r f248e91b1510 statistics-script --- a/statistics-script Sun Apr 11 01:30:44 2010 +0530 +++ b/statistics-script Sun Apr 11 01:56:59 2010 +0530 @@ -24,7 +24,26 @@ plot(l, tsq, 'o') +Additionally the basic equation for finding Time period of simple pendulum we use equation: +T = 2*pi*sqrt(L/g) + +In our case we have t and l already, so to find g value for each element we can simply use: + +g = 4*pi^2*L/T^2 + +g is array with 90 elements, so we take average of all these values to get acceleration due to gravity('g') by + +print mean(g) + +Mean again is provided by pylab module which calculates average of given set of values. +There are other handy statistical functions available, such as median, mode, std(for standard deviation) etc. + +So in this small session we have covered 'better' way of loading data from text files. +Why arrays are better choice then lists in some cases, and how they are helpful during some mathematical operations. + +Thank you! +----------------------------------------------------------------------------------------------------------- In this tutorial we shall learn how to compute statistics using python. We also shall learn how to represent data in the form of pie charts.