import sys
import os
sys.path.append(os.path.abspath('..'))
from pysal.viz import mapclassify as mc

y = mc.load_example()

mc.MaximumBreaks(y, k=4)

               MaximumBreaks                
 
 Lower              Upper              Count
============================================
           x[i] <=  228.490               52
 228.490 < x[i] <=  546.675                4
 546.675 < x[i] <= 2417.150                1
2417.150 < x[i] <= 4111.450                1
mc.MaximumBreaks(y, k=7)

               MaximumBreaks                
 
 Lower              Upper              Count
============================================
           x[i] <=  146.005               50
 146.005 < x[i] <=  228.490                2
 228.490 < x[i] <=  291.020                1
 291.020 < x[i] <=  350.210                2
 350.210 < x[i] <=  546.675                1
 546.675 < x[i] <= 2417.150                1
2417.150 < x[i] <= 4111.450                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