equal
deleted
inserted
replaced
22 |
22 |
23 Now to plot l vs tsq is same as we did in previous session |
23 Now to plot l vs tsq is same as we did in previous session |
24 |
24 |
25 plot(l, tsq, 'o') |
25 plot(l, tsq, 'o') |
26 |
26 |
|
27 Additionally the basic equation for finding Time period of simple pendulum we use equation: |
27 |
28 |
|
29 T = 2*pi*sqrt(L/g) |
|
30 |
|
31 In our case we have t and l already, so to find g value for each element we can simply use: |
|
32 |
|
33 g = 4*pi^2*L/T^2 |
|
34 |
|
35 g is array with 90 elements, so we take average of all these values to get acceleration due to gravity('g') by |
|
36 |
|
37 print mean(g) |
|
38 |
|
39 Mean again is provided by pylab module which calculates average of given set of values. |
|
40 There are other handy statistical functions available, such as median, mode, std(for standard deviation) etc. |
|
41 |
|
42 So in this small session we have covered 'better' way of loading data from text files. |
|
43 Why arrays are better choice then lists in some cases, and how they are helpful during some mathematical operations. |
|
44 |
|
45 Thank you! |
|
46 ----------------------------------------------------------------------------------------------------------- |
28 In this tutorial we shall learn how to compute statistics using python. |
47 In this tutorial we shall learn how to compute statistics using python. |
29 We also shall learn how to represent data in the form of pie charts. |
48 We also shall learn how to represent data in the form of pie charts. |
30 |
49 |
31 Let us start with the most basic need in statistics, the mean. |
50 Let us start with the most basic need in statistics, the mean. |
32 |
51 |