ó
»›%Yc@s/ddlZddlZddd„ƒYZdS(iÿÿÿÿNt	AnalyticscBséeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zed
„ƒZ
d„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zed„ƒZed„ƒZRS(cCs”||_|jƒ|_|jƒ|_|jƒ|_|jƒ|_|j	ƒ|_
|jƒ|_|j
ƒ|_|jƒ|_|jƒ|_dS(N(t_Analytics__arraytcountt_Analytics__counttsumt_Analytics__sumtavgt_Analytics__avgtmediant_Analytics__mediantmodet_Analytics__modetmint_Analytics__mintmaxt_Analytics__maxtranget_Analytics__rangetstdDevt_Analytics__stdDev(tselftarray((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyt__init__s	cCs|jS(N(R(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pytgetCount!scCs|jS(N(R(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pytgetSum"scCs|jS(N(R(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pytgetAvg#scCs|jS(N(R	(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyt	getMedian$scCs|jS(N(R(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pytgetMode%scCs|jS(N(R
(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pytgetMin&scCs|jS(N(R(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pytgetMax'scCs|jS(N(R(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pytgetRange(scCs|jS(N(R(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyt	getStdDev)scCsBg}x5|D]-}yt|ƒ}|j|ƒWq
q
Xq
W|S(N(tfloattappend(Rtarray2tcoltnum((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyt	normalize.s
cCs
t|jƒS(N(tlenR(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyR>scCs
t|jƒS(N(RR(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyRDscCs|j|jS(N(RR(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyRJscCs
t|jƒS(N(RR(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyRPscCs
t|jƒS(N(RR(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyRVscCs|j|jS(N(RR
(R((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyR\scCsmt|jƒ}|j}d}|d}|dd}|ddkrS||}n||||d}|S(Niii(tsortedRR(RR"RRtmid1tmid2((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyRbs	

cCsÕtjj}d}d}g}t|jƒ}xj|D]b}||krS|d7}q4||krn|}g}n||krŠ|j|ƒnd}|}q4W||krµ|}g}n||krÑ|j|ƒn|S(Niii(tsyst
float_infoRR'RR!(RtprevColt	prevCounttmaxOccurtmodesR"R#((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyR
vs*

	
	cCsQd}x.|jD]#}|tj||jdƒ7}qWtj||jƒ}|S(Nii(RtmathtpowRtsqrtR(RtsqDeltaR#tstd_dev((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyRs
!cCsædt|jƒ}|dt|jƒ7}|dt|jƒ7}|dt|jƒ7}|dt|jƒ7}|dt|jƒ7}|dt|jƒ7}|dt|jƒ7}|d	t|j	ƒ7}|d
t|j
ƒ7}|S(Ns
Data points: s
Count......: s
Sum........: s
Average....: s
Median.....: s
Mode.......: s
Minimum....: s
Maximum....: s
Range......: s
Std.Dev....: (tstrRRRRR	RR
RRR(Rtdata((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyt__str__¨scCs†d}g}|dkr%||}n|dkrDt|Œ|}n|dkr‚x/|D]$}x|D]}|j|ƒqdWqWWn|S(NitrowR#tall(tzipR!(t	array2dimttypetidxtsizeRR8R#((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pytslice¹s


cCst|Œ}|S(N(R:(R;R"((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyt	transposeÏs(t__name__t
__module__RRRRRRRRRRtstaticmethodR%RRRRRRRR
RR7R?R@(((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyRs.																		'		((R0R*R(((s:/home/s/sultans/web/python/demo/oo/zAnalytics/Analytics.pyt<module>	s