<commit_before>{
 "metadata": {
  "name": "",
  "signature": "sha256:dcf48549b623ad9935fedb582474748327b8fd65e1d450c62310b8ff84872199"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "HoloViews"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "**Composable, declarative data structures for building even complex visualizations easily.**"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Introduction"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Holoviews is a [Python](http://python.org) library that makes\n",
      "analyzing and visualizing scientific or engineering data much simpler,\n",
      "more intuitive, and more reproducible.  Here is a simple example of loading a file and displaying it as an image with a histogram, a line marking the x axis, and the value of the data along that line:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from holoviews import *\n",
      "fractal = Image(np.load('mandelbrot.npy'))\n",
      "((fractal * HLine(y=0)).hist() + fractal.sample(y=0))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "You can see that HoloViews can create even quite sophisticated visualizations with a minimum of specification beyond your data itself.  If you wrap your data in a HoloViews component and supply a small amount of metadata describing it, you can then display it immediately on its own or in combination with any other HoloViews object.  The plotting is done by the \n",
      "[Matplotlib](http://matplotlib.org) library, but none of the data structures depend on this plotting code, so that you can easily create, store, and manipulate your data objects as needed.  HoloViews objects support arbitrary combination, selection, slicing, sorting, sampling, and animation, to allow you to focus on whatever aspect of your data you wish, and the result will simply display itself without further coding. With Holoviews, you can see precisely what you are interested in exploring,\n",
      "without spending time on writing or maintaining plotting code.  \n",
      "\n",
      "Here you can see how even extremely complex relationships between data elements can be expressed very easily in HoloViews:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%%opts Points [scaling_factor=50] Contours (color='w')\n",
      "from holoviews.operation import threshold, contours\n",
      "dots, ys = np.linspace(-0.45,0.45,19), np.linspace(-0.3, 0.3, 21)\n",
      "\n",
      "data = {\n",
      "  y: (fractal * fractal.sample([(i,y) for i in dots]).to.points(['x','y'], 'z')\n",
      "   + fractal.sample(y=y)\n",
      "   + threshold(fractal,  level=np.percentile(fractal.sample(y=y).data, 90))\n",
      "   + contours(fractal, levels=[np.percentile(fractal.sample(y=y).data, 50)]))\n",<commit_msg>Removed unnecessary imports of operations by qualifying namespace<commit_after>{
 "metadata": {
  "name": "",
  "signature": "sha256:064eda90c0feb4ff5cbef99d5ee27f8f693197197d2f21645f98673541b45006"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "HoloViews"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "**Composable, declarative data structures for building even complex visualizations easily.**"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Introduction"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Holoviews is a [Python](http://python.org) library that makes\n",
      "analyzing and visualizing scientific or engineering data much simpler,\n",
      "more intuitive, and more reproducible.  Here is a simple example of loading a file and displaying it as an image with a histogram, a line marking the x axis, and the value of the data along that line:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from holoviews import *\n",
      "fractal = Image(np.load('mandelbrot.npy'))\n",
      "((fractal * HLine(y=0)).hist() + fractal.sample(y=0))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "You can see that HoloViews can create even quite sophisticated visualizations with a minimum of specification beyond your data itself.  If you wrap your data in a HoloViews component and supply a small amount of metadata describing it, you can then display it immediately on its own or in combination with any other HoloViews object.  The plotting is done by the \n",
      "[Matplotlib](http://matplotlib.org) library, but none of the data structures depend on this plotting code, so that you can easily create, store, and manipulate your data objects as needed.  HoloViews objects support arbitrary combination, selection, slicing, sorting, sampling, and animation, to allow you to focus on whatever aspect of your data you wish, and the result will simply display itself without further coding. With Holoviews, you can see precisely what you are interested in exploring,\n",
      "without spending time on writing or maintaining plotting code.  \n",
      "\n",
      "Here you can see how even extremely complex relationships between data elements can be expressed very easily in HoloViews:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%%opts Points [scaling_factor=50] Contours (color='w')\n",
      "dots, ys = np.linspace(-0.45,0.45,19), np.linspace(-0.3, 0.3, 21)\n",
      "\n",
      "data = {\n",
      "  y: (fractal * fractal.sample([(i,y) for i in dots]).to.points(['x','y'], 'z')\n",
      "   + fractal.sample(y=y)\n",
      "   + operation.threshold(fractal,  level=np.percentile(fractal.sample(y=y).data, 90))\n",
      "   + operation.contours(fractal, levels=[np.percentile(fractal.sample(y=y).data, 50)]))\n",
{'fraction_non_alphanumeric': 0.13756777691711852, 'fraction_numerical': 0.022463206816421378, 'mean_word_length': 3.022429906542056, 'pattern_counts': {'":': 66, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3548620', 'n_tokens_mistral': 2103, 'n_tokens_neox': 1971, 'n_words': 647}