Search
maximum_breaks
import sys
import os
sys.path.append(os.path.abspath('..'))
import mapclassify as mc
y = mc.load_example()
mc.MaximumBreaks(y, k=4)
MaximumBreaks             

     Interval        Count
--------------------------
[   0.13,  228.49] |    52
( 228.49,  546.67] |     4
( 546.67, 2417.15] |     1
(2417.15, 4111.45] |     1
mc.MaximumBreaks(y, k=7)
MaximumBreaks             

     Interval        Count
--------------------------
[   0.13,  146.00] |    50
( 146.00,  228.49] |     2
( 228.49,  291.02] |     1
( 291.02,  350.21] |     2
( 350.21,  546.67] |     1
( 546.67, 2417.15] |     1
(2417.15, 4111.45] |     1
mb7 = mc.MaximumBreaks(y, k=7)
mb7.bins
array([ 146.005,  228.49 ,  291.02 ,  350.21 ,  546.675, 2417.15 ,
       4111.45 ])
mb7.counts
array([50,  2,  1,  2,  1,  1,  1])
mb7.yb
array([3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 3, 0, 2, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
mb7.adcm
727.3200000000002