{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import sys\n", "import os\n", "sys.path.append(os.path.abspath('..'))\n", "import mapclassify as mc" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "y = mc.load_example()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ " MaximumBreaks \n", " \n", " Lower Upper Count\n", "============================================\n", " x[i] <= 228.490 52\n", " 228.490 < x[i] <= 546.675 4\n", " 546.675 < x[i] <= 2417.150 1\n", "2417.150 < x[i] <= 4111.450 1" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mc.MaximumBreaks(y, k=4)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ " MaximumBreaks \n", " \n", " Lower Upper Count\n", "============================================\n", " x[i] <= 146.005 50\n", " 146.005 < x[i] <= 228.490 2\n", " 228.490 < x[i] <= 291.020 1\n", " 291.020 < x[i] <= 350.210 2\n", " 350.210 < x[i] <= 546.675 1\n", " 546.675 < x[i] <= 2417.150 1\n", "2417.150 < x[i] <= 4111.450 1" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mc.MaximumBreaks(y, k=7)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": true }, "outputs": [], "source": [ "mb7 = mc.MaximumBreaks(y, k=7)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([ 146.005, 228.49 , 291.02 , 350.21 , 546.675, 2417.15 ,\n", " 4111.45 ])" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mb7.bins" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([50, 2, 1, 2, 1, 1, 1])" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mb7.counts" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,\n", " 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 3, 0, 2, 0,\n", " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mb7.yb" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "727.3200000000002" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mb7.adcm" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 2 }