<commit_before>{
 "metadata": {
  "name": "",
  "signature": "sha256:6e29ae1a4d1e86d7600cd42d86e8fab664387599548aa48f6a41418f55668a3d"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "HoloViews is a [Python](http://python.org) library that makes analyzing and visualizing scientific or engineering data much simpler, more intuitive, and more reproducible.  For instance, if you have a two-dimensional dataset like the fractal below, it only takes one line of HoloViews code to mark it with a horizontal line indicating a cross section, add its histogram, sample to get the cross section, and display the result:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from holoviews import *\n",
      "%load_ext holoviews.ipython\n",
      "fractal = Image(np.load('mandelbrot.npy'))\n",
      "\n",
      "((fractal * HLine(y=0)).hist() + fractal.sample(y=0))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "To use HoloViews, you first wrap your data in a HoloViews component along with optional metadata describing it.  It will then display itself automatically on its own or in combination with any other HoloViews component.  The separate [matplotlib](http://matplotlib.org) library does the plotting, but none of the data structures depend on the plotting code, so that you can easily create, save, load, and manipulate HoloViews objects from within your own programs.  HoloViews objects support arbitrary combination, selection, slicing, sorting, sampling, and animation, to allow you to focus on whatever aspect of your data you wish. Instead of writing or maintaining complex plotting code, just declare what data you want to see, and HoloViews will handle the rest."
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "More detailed example"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Even extremely complex relationships between data elements can be expressed succinctly in HoloViews:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%%opts Points [scaling_factor=50] Contours (color='w')\n",
      "dots = np.linspace(-0.45, 0.45, 19)\n",
      "\n",
      "d={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, 60)]))\n",
      "     for y in np.linspace(-0.3, 0.3, 21)}\n",
      "\n",
      "Layout.collate(d, kdims=['Y']).cols(2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Here we have taken the same fractal data and indicated a horizontal cross section using a set of dots with sizes proportional to the underlying data values in **A**, illustrating how even a simple annotation can be used to reflect other data of interest.  We then add a cross section curve **B**, a thresholded version of the data **C**, and a version of the data with a contour outline overlaid **D**.  Here the threshold and contour levels are not fixed, but are calculated as the 90th or 60th percentile of the data values along that cross section.  All of this data is then packaged into a single data structure for a range of cross sections, allowing the data for a particular cross section to be revealed by moving the Y-value slider at right.  Even with these complicated interrelationships between data elements, the code still only needs to focus on the data that you want to see, not on the details of the plotting.\n",
      "\n",
      "Note that just as the 2D array became a 1D curve automatically by sampling to get the cross section, this entire figure would become a single static frame with no slider bar if you chose a specific ``Y`` value by re-running with ``.select(Y=0.3)`` before ``.cols(2)``.  In fact, there is nothing in the code above that adds the slider bar explicitly -- it appears automatically just because there is an additional dimension of data (``Y`` in this case) that has not been laid out spatially.  Additional sliders would appear if there were other dimensions being varied, e.g. for parameter space explorations.\n",
      "\n",
      "This functionality is designed to complement the [IPython Notebook](http://ipython.org/notebook/) interface, though it can be used just as well separately.  This web page and all the [HoloViews Tutorials](Tutorials/) are runnable notebooks, which allow you to interleave text, Python code, and graphical results easily.  With HoloViews, you can just put a minimum of code in the notebook (typically one or two lines per subfigure), specifying what you would like to see rather than the details of how it should be plotted.  HoloViews makes the IPython Notebook a practical solution for both exploratory research (since viewing nearly any chunk of data just takes a line or two of code) and for long-term [reproducibility](Tutorials/Exporting) of the work (because both the code and the resulting figure are preserved in the notebook file forever).  See the [Tutorials](Tutorials/) for detailed examples, and then start enjoying working with your data!"
     ]
    }
   ],
   "metadata": {}
  }
 ]
}<commit_msg>Updated homepage example to avoid deprecated Layout.collate<commit_after>{
 "metadata": {
  "name": "",
  "signature": "sha256:a089c698d9a868f40a9348c0c9ee6531c3d727905aeb3a0d937042df09596d9a"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "HoloViews is a [Python](http://python.org) library that makes analyzing and visualizing scientific or engineering data much simpler, more intuitive, and more reproducible.  For instance, if you have a two-dimensional dataset like the fractal below, it only takes one line of HoloViews code to mark it with a horizontal line indicating a cross section, add its histogram, sample to get the cross section, and display the result:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from holoviews import *\n",
      "%load_ext holoviews.ipython\n",
      "fractal = Image(np.load('mandelbrot.npy'))\n",
      "\n",
      "((fractal * HLine(y=0)).hist() + fractal.sample(y=0))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "To use HoloViews, you first wrap your data in a HoloViews component along with optional metadata describing it.  It will then display itself automatically on its own or in combination with any other HoloViews component.  The separate [matplotlib](http://matplotlib.org) library does the plotting, but none of the data structures depend on the plotting code, so that you can easily create, save, load, and manipulate HoloViews objects from within your own programs.  HoloViews objects support arbitrary combination, selection, slicing, sorting, sampling, and animation, to allow you to focus on whatever aspect of your data you wish. Instead of writing or maintaining complex plotting code, just declare what data you want to see, and HoloViews will handle the rest."
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "More detailed example"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Even extremely complex relationships between data elements can be expressed succinctly in HoloViews:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%%opts Points [scaling_factor=50] Contours (color='w')\n",
      "dots = np.linspace(-0.45, 0.45, 19)\n",
      "\n",
      "HoloMap({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, 60)]))\n",
      "     for y in np.linspace(-0.3, 0.3, 21)}).collate().cols(2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Here we have taken the same fractal data and indicated a horizontal cross section using a set of dots with sizes proportional to the underlying data values in **A**, illustrating how even a simple annotation can be used to reflect other data of interest.  We then add a cross section curve **B**, a thresholded version of the data **C**, and a version of the data with a contour outline overlaid **D**.  Here the threshold and contour levels are not fixed, but are calculated as the 90th or 60th percentile of the data values along that cross section.  All of this data is then packaged into a single data structure for a range of cross sections, allowing the data for a particular cross section to be revealed by moving the Y-value slider at right.  Even with these complicated interrelationships between data elements, the code still only needs to focus on the data that you want to see, not on the details of the plotting.\n",
      "\n",
      "Note that just as the 2D array became a 1D curve automatically by sampling to get the cross section, this entire figure would become a single static frame with no slider bar if you chose a specific ``Y`` value by re-running with ``.select(Y=0.3)`` before ``.cols(2)``.  In fact, there is nothing in the code above that adds the slider bar explicitly -- it appears automatically just because there is an additional dimension of data (``Y`` in this case) that has not been laid out spatially.  Additional sliders would appear if there were other dimensions being varied, e.g. for parameter space explorations.\n",
      "\n",
      "This functionality is designed to complement the [IPython Notebook](http://ipython.org/notebook/) interface, though it can be used just as well separately.  This web page and all the [HoloViews Tutorials](Tutorials/) are runnable notebooks, which allow you to interleave text, Python code, and graphical results easily.  With HoloViews, you can just put a minimum of code in the notebook (typically one or two lines per subfigure), specifying what you would like to see rather than the details of how it should be plotted.  HoloViews makes the IPython Notebook a practical solution for both exploratory research (since viewing nearly any chunk of data just takes a line or two of code) and for long-term [reproducibility](Tutorials/Exporting) of the work (because both the code and the resulting figure are preserved in the notebook file forever).  See the [Tutorials](Tutorials/) for detailed examples, and then start enjoying working with your data!"
     ]
    }
   ],
   "metadata": {}
  }
 ]
}
{'fraction_non_alphanumeric': 0.1035240355039986, 'fraction_numerical': 0.014236751911415766, 'mean_word_length': 3.450527962456003, 'pattern_counts': {'":': 72, '<': 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': '7275551', 'n_tokens_mistral': 3314, 'n_tokens_neox': 3132, 'n_words': 1411}