Created
May 20, 2015 05:36
-
-
Save sergiobuj/f5f9c4234082a1486da2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "execution_count": 71, | |
| "metadata": { | |
| "collapsed": false | |
| }, | |
| "outputs": [], | |
| "source": [ | |
| "import clusterpy as cls\n", | |
| "from clusterpy.core.toolboxes.cluster.componentsAlg.distanceFunctions import distMethods" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 72, | |
| "metadata": { | |
| "collapsed": false | |
| }, | |
| "outputs": [ | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "Creating grid\n", | |
| "Done\n" | |
| ] | |
| }, | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "[[[(0, 30), (10, 30), (10, 20), (0, 20), (0, 30)]],\n", | |
| " [[(10, 30), (20, 30), (20, 20), (10, 20), (10, 30)]],\n", | |
| " [[(20, 30), (30, 30), (30, 20), (20, 20), (20, 30)]],\n", | |
| " [[(0, 20), (10, 20), (10, 10), (0, 10), (0, 20)]],\n", | |
| " [[(10, 20), (20, 20), (20, 10), (10, 10), (10, 20)]],\n", | |
| " [[(20, 20), (30, 20), (30, 10), (20, 10), (20, 20)]],\n", | |
| " [[(0, 10), (10, 10), (10, 0), (0, 0), (0, 10)]],\n", | |
| " [[(10, 10), (20, 10), (20, 0), (10, 0), (10, 10)]],\n", | |
| " [[(20, 10), (30, 10), (30, 0), (20, 0), (20, 10)]]]" | |
| ] | |
| }, | |
| "execution_count": 72, | |
| "metadata": {}, | |
| "output_type": "execute_result" | |
| } | |
| ], | |
| "source": [ | |
| "grid = cls.createGrid(3, 3)\n", | |
| "grid.areas" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 73, | |
| "metadata": { | |
| "collapsed": false | |
| }, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "30" | |
| ] | |
| }, | |
| "execution_count": 73, | |
| "metadata": {}, | |
| "output_type": "execute_result" | |
| } | |
| ], | |
| "source": [ | |
| "distMethods['Hausdorff'](grid.areas[6][0], grid.areas[1][0])" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": { | |
| "collapsed": true | |
| }, | |
| "outputs": [], | |
| "source": [] | |
| } | |
| ], | |
| "metadata": { | |
| "kernelspec": { | |
| "display_name": "Python 2", | |
| "language": "python", | |
| "name": "python2" | |
| }, | |
| "language_info": { | |
| "codemirror_mode": { | |
| "name": "ipython", | |
| "version": 2 | |
| }, | |
| "file_extension": ".py", | |
| "mimetype": "text/x-python", | |
| "name": "python", | |
| "nbconvert_exporter": "python", | |
| "pygments_lexer": "ipython2", | |
| "version": "2.7.6" | |
| } | |
| }, | |
| "nbformat": 4, | |
| "nbformat_minor": 0 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment