ó
žYc@svddlZddlZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd	„Z	d
„Z
d„ZdS(iÿÿÿÿNcCsBg}x5|D]-}yt|ƒ}|j|ƒWq
q
Xq
W|S(N(tfloattappend(tarraytarray2tcoltnum((s6/home/s/sultans/web/python/demo/analytics/Analytics.pyt	normalizes
cCs
t|ƒS(N(tlen(R((s6/home/s/sultans/web/python/demo/analytics/Analytics.pytcountscCs t|ƒ}t|ƒ}||S(N(Rtsum(Rtcounterttotal((s6/home/s/sultans/web/python/demo/analytics/Analytics.pytavg#scCsgt|ƒ}t|ƒ}|d}|dd}|ddkrM||}n||||d}|S(Nii(tsortedR(RRRtmid1tmid2tmedian((s6/home/s/sultans/web/python/demo/analytics/Analytics.pyR+s

cCsÒtjj}d}d}g}t|ƒ}xj|D]b}||krP|d7}q1||krk|}g}n||kr‡|j|ƒnd}|}q1W||kr²|}g}n||krÎ|j|ƒn|S(Niii(tsyst
float_infotminR
R(RtprevColt	prevCounttmaxOccurtmodesRR((s6/home/s/sultans/web/python/demo/analytics/Analytics.pytmode<s*

	
	cCs t|ƒ}t|ƒ}||S(N(Rtmax(Rtmin1tmax1((s6/home/s/sultans/web/python/demo/analytics/Analytics.pytrange\scCsjt|ƒ}t|ƒ}||}d}x(|D] }|tj||dƒ7}q/Wtj||ƒ}|S(Nii(RR	tmathtpowtsqrt(RR
RtaveragetsqDeltaRtstd_dev((s6/home/s/sultans/web/python/demo/analytics/Analytics.pytstdDevls

cCsþdt|ƒ}|dtt|ƒƒ7}|dtt|ƒƒ7}|dtt|ƒƒ7}|dtt|ƒƒ7}|dtt|ƒƒ7}|dtt|ƒƒ7}|dtt|ƒƒ7}|d	tt|ƒƒ7}|d
tt	|ƒƒ7}|S(Ns
Data points: s
Count......: s
Sum........: s
Average....: s
Median.....: s
Mode.......: s
Minimum....: s
Maximum....: s
Range......: s
Std.Dev....: (
tstrRR	RRRRRRR#(Rtdata((s6/home/s/sultans/web/python/demo/analytics/Analytics.pyttoString{scCs†d}g}|dkr%||}n|dkrDt|Œ|}n|dkr‚x/|D]$}x|D]}|j|ƒqdWqWWn|S(NitrowRtall(tzipR(t	array2dimttypetidxtsizeRR'R((s6/home/s/sultans/web/python/demo/analytics/Analytics.pytsliceŒs


cCst|Œ}|S(N(R)(R*R((s6/home/s/sultans/web/python/demo/analytics/Analytics.pyt	transpose¡s(RRRRRRRRR#R&R.R/(((s6/home/s/sultans/web/python/demo/analytics/Analytics.pyt<module>	s