<commit_before>{
 "metadata": {
  "name": "",
  "signature": "sha256:5bbffc8befc7614b5b41081bdfbc7c6d7dd81047993e161c527ceb47e3198fae"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Pandas is one of the most popular Python libraries providing high-performance, easy-to-use data structures and data analysis tools.  Additionally it provides IO interfaces to store and load your data in a variety of formats including csv files, json, pickles and even databases. In other words it makes loading data, munging data and even complex data analysis tasks a breeze.\n",
      "\n",
      "Combining the high-performance data analysis tools and IO capabilities that Pandas provides with interactivity and ease of generating complex visualization in HoloViews makes the two libraries a perfect match.\n",
      "\n",
      "In this tutorial we will explore how you can easily convert between Pandas dataframes and HoloViews components. The tutorial assumes you already familiar with some of the core concepts of both libraries, so if you need a refresher on HoloViews have a look at the [Introduction](http://ioam.github.io/holoviews/Tutorials/Introduction) and [Exploring Data](http://ioam.github.io/holoviews/Tutorials/Exploring_Data)."
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "## Basic conversions"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%output holomap='widgets'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import pandas as pd\n",
      "from holoviews import *\n",
      "from IPython.display import HTML\n",
      "%load_ext holoviews.ipython"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "The first thing to understand when working with pandas dataframes in HoloViews is how data is indexed. Pandas dataframes are structured as tables with any number of columns and indexes. HoloViews on the other hand deals with Dimensions. HoloViews container objects such as the [HoloMap](https://ioam.github.io/holoviews/Tutorials/Containers.html#HoloMap), [NdLayout](https://ioam.github.io/holoviews/Tutorials/Containers.html#NdLayout), [GridSpace](https://ioam.github.io/holoviews/Tutorials/Containers.html#GridSpace) and [NdOverlay](https://ioam.github.io/holoviews/Tutorials/Containers.html#NdOverlay) have key_dimensions, which provide metadata about the data along that dimension and how they can be sliced. [Element](https://ioam.github.io/holoviews/Tutorials/Elements.html) objects on the other hand have both key_dimensions and value_dimensions. The difference between key_dimensions and value_dimensions in HoloViews is that the former may be sliced and indexed while the latter merely provide a description about the values along that Dimension.\n",
      "\n",
      "Let's start by constructing a Pandas dataframe of a few columns and display it as it's html format (throughtout this notebook we will visualize the DFrames using the IPython HTML display function, to allow this notebook to be tested, you can of course visualize dataframes directly)."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "df = pd.DataFrame({'a':[1,2,3,4], 'b':[4,5,6,7], 'c':[8, 9, 10, 11]})\n",
      "HTML(df.to_html())"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Now that we have a basic dataframe we can wrap it in the HoloViews DFrame wrapper element.\n",
      "<h3 class='alert alert-warning'>Note: In the development version of HoloViews you may now pass data any data a pandas dataframe accepts straight to the DFrame Element constructor, which it will convert to a pandas dataframe internally.</h3>\n"
     ]
    },
    {
     "cell_type": "code",<commit_msg>Removed note about functionality in next release<commit_after>{
 "metadata": {
  "name": "",
  "signature": "sha256:7d19308d2314e3bfe27cf6b2caf781e7a1456bdb1980d6ec88a00033f79f9b7e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Pandas is one of the most popular Python libraries providing high-performance, easy-to-use data structures and data analysis tools.  Additionally it provides IO interfaces to store and load your data in a variety of formats including csv files, json, pickles and even databases. In other words it makes loading data, munging data and even complex data analysis tasks a breeze.\n",
      "\n",
      "Combining the high-performance data analysis tools and IO capabilities that Pandas provides with interactivity and ease of generating complex visualization in HoloViews makes the two libraries a perfect match.\n",
      "\n",
      "In this tutorial we will explore how you can easily convert between Pandas dataframes and HoloViews components. The tutorial assumes you already familiar with some of the core concepts of both libraries, so if you need a refresher on HoloViews have a look at the [Introduction](http://ioam.github.io/holoviews/Tutorials/Introduction) and [Exploring Data](http://ioam.github.io/holoviews/Tutorials/Exploring_Data)."
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "## Basic conversions"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%output holomap='widgets'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import pandas as pd\n",
      "from holoviews import *\n",
      "from IPython.display import HTML\n",
      "%load_ext holoviews.ipython"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "The first thing to understand when working with pandas dataframes in HoloViews is how data is indexed. Pandas dataframes are structured as tables with any number of columns and indexes. HoloViews on the other hand deals with Dimensions. HoloViews container objects such as the [HoloMap](https://ioam.github.io/holoviews/Tutorials/Containers.html#HoloMap), [NdLayout](https://ioam.github.io/holoviews/Tutorials/Containers.html#NdLayout), [GridSpace](https://ioam.github.io/holoviews/Tutorials/Containers.html#GridSpace) and [NdOverlay](https://ioam.github.io/holoviews/Tutorials/Containers.html#NdOverlay) have key_dimensions, which provide metadata about the data along that dimension and how they can be sliced. [Element](https://ioam.github.io/holoviews/Tutorials/Elements.html) objects on the other hand have both key_dimensions and value_dimensions. The difference between key_dimensions and value_dimensions in HoloViews is that the former may be sliced and indexed while the latter merely provide a description about the values along that Dimension.\n",
      "\n",
      "Let's start by constructing a Pandas dataframe of a few columns and display it as it's html format (throughtout this notebook we will visualize the DFrames using the IPython HTML display function, to allow this notebook to be tested, you can of course visualize dataframes directly)."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "df = pd.DataFrame({'a':[1,2,3,4], 'b':[4,5,6,7], 'c':[8, 9, 10, 11]})\n",
      "HTML(df.to_html())"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Now that we have a basic dataframe we can wrap it in the HoloViews DFrame wrapper element."
     ]
    },
    {
     "cell_type": "code",
{'fraction_non_alphanumeric': 0.11543673771097696, 'fraction_numerical': 0.014044597757792288, 'mean_word_length': 3.423978201634877, 'pattern_counts': {'":': 76, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 10, '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': '4653163', 'n_tokens_mistral': 2510, 'n_tokens_neox': 2386, 'n_words': 824}