<commit_before>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Import the module"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import nvd3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "Prepare the data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x = [\"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\",\"Eight\"]\n",
    "y = [29.76, 0, 32.80, 196.45, 0.19, 98.07, 13.92, 5.138]\n",
    "data = [{\"label\": l, \"value\": v} for l, v in zip(x, y)]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "Construct the chart"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "pie_chart = nvd3.PieChart()\n",
    "pie_chart.x(\"function(d) { return d.label; }\")\n",
    "pie_chart.y(\"function(d) { return d.value; }\")\n",
    "pie_chart.showLabels(True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "Display the HTML"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "application/javascript": [
       "$(\"head\").append($(\"<link/>\").attr({\n",
       "  rel:  \"stylesheet\",\n",
       "  type: \"text/css\",\n",
       "  href: \"https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.3/nv.d3.min.css\"\n",
       "}));\n",
       "$.getScript(\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js\", function () {\n",
       "$.getScript(\"https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.3/nv.d3.min.js\", function () {\n",
       "nv.addGraph(function() {\n",
       "    var data_chart = [{\"value\": 29.76, \"label\": \"One\"}, {\"value\": 0, \"label\": \"Two\"}, {\"value\": 32.8, \"label\": \"Three\"}, {\"value\": 196.45, \"label\": \"Four\"}, {\"value\": 0.19, \"label\": \"Five\"}, {\"value\": 98.07, \"label\": \"Six\"}, {\"value\": 13.92, \"label\": \"Seven\"}, {\"value\": 5.138, \"label\": \"Eight\"}];\n",
       "    (function(data) {\n",
       "    var chart = nv.models.pieChart();\n",
       "    chart.y(function(d) { return d.value; });\n",
       "chart.x(function(d) { return d.label; });\n",
       "chart.showLabels(true);\n",
       "\n",
       "\n",
       "\n",
       "    d3.select(\"#nvd3_chart_833 svg\")\n",
       "        .datum(data)\n",
       "        .transition().duration(350)\n",
       "        .call(chart);\n",
       "\n",
       "    return chart;\n",
       "})(data_chart);\n",
       "});});\n",
       "});\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div id=\"nvd3_chart_833\">\n",
       "    <svg style=\"height:500px;width:400px\"></svg>\n",
       "</div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data_supplier = nvd3.StaticDataSupplier(data)\n",
    "nvd3.IPythonContainer(pie_chart, data_supplier)"
   ]
  },
  {
   "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",<commit_msg>Remove unused cell.<commit_after>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Import the module"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import nvd3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "Prepare the data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x = [\"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\",\"Eight\"]\n",
    "y = [29.76, 0, 32.80, 196.45, 0.19, 98.07, 13.92, 5.138]\n",
    "data = [{\"label\": l, \"value\": v} for l, v in zip(x, y)]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "Construct the chart"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "pie_chart = nvd3.PieChart()\n",
    "pie_chart.x(\"function(d) { return d.label; }\")\n",
    "pie_chart.y(\"function(d) { return d.value; }\")\n",
    "pie_chart.showLabels(True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "Display the HTML"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "application/javascript": [
       "$(\"head\").append($(\"<link/>\").attr({\n",
       "  rel:  \"stylesheet\",\n",
       "  type: \"text/css\",\n",
       "  href: \"https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.3/nv.d3.min.css\"\n",
       "}));\n",
       "$.getScript(\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js\", function () {\n",
       "$.getScript(\"https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.3/nv.d3.min.js\", function () {\n",
       "nv.addGraph(function() {\n",
       "    var data_chart = [{\"value\": 29.76, \"label\": \"One\"}, {\"value\": 0, \"label\": \"Two\"}, {\"value\": 32.8, \"label\": \"Three\"}, {\"value\": 196.45, \"label\": \"Four\"}, {\"value\": 0.19, \"label\": \"Five\"}, {\"value\": 98.07, \"label\": \"Six\"}, {\"value\": 13.92, \"label\": \"Seven\"}, {\"value\": 5.138, \"label\": \"Eight\"}];\n",
       "    (function(data) {\n",
       "    var chart = nv.models.pieChart();\n",
       "    chart.y(function(d) { return d.value; });\n",
       "chart.x(function(d) { return d.label; });\n",
       "chart.showLabels(true);\n",
       "\n",
       "\n",
       "\n",
       "    d3.select(\"#nvd3_chart_833 svg\")\n",
       "        .datum(data)\n",
       "        .transition().duration(350)\n",
       "        .call(chart);\n",
       "\n",
       "    return chart;\n",
       "})(data_chart);\n",
       "});});\n",
       "});\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div id=\"nvd3_chart_833\">\n",
       "    <svg style=\"height:500px;width:400px\"></svg>\n",
       "</div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data_supplier = nvd3.StaticDataSupplier(data)\n",
    "nvd3.IPythonContainer(pie_chart, data_supplier)"
   ]
  }
 ],
 "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",
{'fraction_non_alphanumeric': 0.26696712619300106, 'fraction_numerical': 0.02704135737009544, 'mean_word_length': 2.134607395097632, 'pattern_counts': {'":': 164, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 6, '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': '3460855', 'n_tokens_mistral': 3139, 'n_tokens_neox': 2951, 'n_words': 476}