Skip to content

Instantly share code, notes, and snippets.

@davidshinn
Last active August 28, 2015 16:15
Show Gist options
  • Save davidshinn/ee7f49651bc0d26f1b6e to your computer and use it in GitHub Desktop.
Save davidshinn/ee7f49651bc0d26f1b6e to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Passing data between Python and R Using rpy2.ipython\n",
"Reference `rpy2.ipython` docs at http://rpy.sourceforge.net/rpy2/doc-2.4/html/interactive.html#module-rpy2.ipython.rmagic"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%load_ext rpy2.ipython"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"import pandas as pd\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Plot a histogram of speed from the cars dataset in R"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%%R\n",
"library(ggplot2)\n",
"data(cars)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false,
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
"'data.frame':\t50 obs. of 2 variables:\n",
" $ speed: num 4 4 7 7 8 9 10 10 10 11 ...\n",
" $ dist : num 2 10 4 22 16 10 18 26 34 17 ...\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%R\n",
"str(cars)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAHgCAMAAABKCk6nAAACJVBMVEUAAAAGBgYHBwcJCQkLCwsM\nDAwODg4PDw8QEBARERESEhITExMUFBQVFRUWFhYXFxcYGBgZGRkcHBwdHR0f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veX32ciObMfIYKzYwWRTtTrH0\nxPCW3mO2JorigvP3LhZF9+HWwNblb1qHiyPrig+3em1Y/rKu9/4eNbIZI4+xYmumen9gnisuvPgh\n1zrxpN0/fKv3ph0rWk9vWv6mB9w+vfjY4aKYfWX5y/oe8JiRzRh5jBW76JrO3057vfjISHe4tXj8\nST/x4oG1RXFOtzX+0eVvWtcuXvu14ntXzY2f953lL1sunZ69wshmjDzGio2ev+7M3h+ydq0/e+uX\ntxx/0qF1G28virsfag3vXf6mdfXAF14qpq/YuP7K2eUv7YvXnbnbyGaMPEZkrRV/aTLrz7dyAL9/\nujv3AWrufQ9sPYCNB7DxADYewMYD2HgAGw9g4/0fEbbBGth0qtQAAAAASUVORK5CYII=\n"
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%R\n",
"qplot(cars$speed, binwidth = 1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Pass the cars dataset from R to Python"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%R -n -o cars cars"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'pandas.core.frame.DataFrame'>\n",
"Int64Index: 50 entries, 0 to 49\n",
"Data columns (total 2 columns):\n",
"speed 50 non-null float64\n",
"dist 50 non-null float64\n",
"dtypes: float64(2)\n",
"memory usage: 1.2 KB\n"
]
}
],
"source": [
"cars.info()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f50900c2850>"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAd4AAAFXCAYAAAAMIS/TAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEiBJRE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85+Pm2++OR5//PGMmQCgbo0a3uHh\n4Xj44Ydjx44dsWvXrti1a1e88cYbWbMBQN0ZNbwHDhyID3/4w7Fw4cKYPXt2fOELX4gXX3wxazYA\nqDujhvfEiRPxoQ996OJ/z58/P06cODHpQwFAvWoY7YOFQiFrjmmnUChEvP16jMSpstYPXj0Qb7zx\n32WtPXLkcAyc7ilrbUTEO2eKEVH+320l62fqsStdb/baHHvgdE8cOXK47PWVvFZruW+VfH5hbIVS\nqVS60gf/+Mc/xvbt2+MnP/lJREQ89thjUSgU4mtf+1ragABQT0a91fyJT3wiDh8+HMeOHYvBwcH4\nzW9+E6tXr86aDQDqzqi3mhsaGuLb3/523HPPPTEyMhJf/vKXo6urK2s2AKg7o95qBgCqyztXAUAi\n4QWARMILAIlG/eGqidizZ0888sgjF38Iy68cXdmqVauiqakprrrqqmhoaIhnnnmm1iNNCQ8++GDs\n3r072tvb49e//nVERJw6dSruu++++Oc//xkLFiyIH//4xzFv3rwaT1pbl9un7du3xy9/+ctoa2uL\niIju7u747Gc/W8sxa+748eOxdevWKBaLUSgUYuPGjXHnnXe6pi7jSnvlurrUu+++G5s2bYrBwcEY\nGhqK1atXx/333z/xa6pUBefPny+tWbOmdPTo0dLg4GBp3bp1pddff70aT12XPve5z5VOnjxZ6zGm\nnFdffbX02muvlb74xS9e/LPvf//7pccff7xUKpVKjz32WOnRRx+t1XhTxuX2afv27aUnnniihlNN\nPT09PaW//OUvpVKpVOrv7y/dfPPNpddff901dRlX2ivX1QcNDAyUSqVSaWhoqLRhw4bSq6++OuFr\nqiq3mr2n88SV/DD5ByxbtuwDXyW+9NJLceutt0ZExK233hovvPBCLUabUi63TxGuqffr6OiIJUuW\nREREU1NTdHV1xYkTJ1xTl3GlvYpwXb3f3LlzIyJiaGgohoeHo7W1dcLXVFXC6z2dJ6ZQKMTdd98d\nt912W/ziF7+o9ThTWl9fX1x33XUREXHddddFX19fjSeaun7605/GunXr4qGHHoq333671uNMKceO\nHYuDBw/G0qVLXVNjuLBXn/zkJyPCdfV+IyMjccstt8SKFSti+fLl8fGPf3zC11RVwus9nSfm6aef\njueeey527NgRP/vZz2L//v21HmlaKBQKrrUr+MpXvhIvvvhi7Ny5Mzo6OuJ73/terUeaMs6ePRtb\ntmyJbdu2RXNz8yUfc01d6r171dTU5Lq6jFmzZsXOnTtjz549sX///vjd7353ycfHc01VJbzz58+P\n48ePX/zvN998M+bPn1+Np65LnZ2dERHR1tYWN910Uxw4cKDGE01d7e3t0dvbGxERPT09F3/Ig0u1\nt7dffMFv2LAh/vSnP9V6pClhaGgotmzZEuvWrYs1a9ZEhGvqSq60V66ry2tpaYmVK1fGa6+9NuFr\nqirh9Z7O4/fOO+9Ef39/REQMDAzEyy+/HIsXL67xVFPXqlWr4tlnn42IiOeee+7iJwQu1dPz//83\nmRdeeME1Ff/7vclt27ZFV1dX3HXXXRf/3DX1QVfaK9fVpYrF4sXb7efOnYtXXnklbrjhhglfU1V7\ny8jdu3df8utEX//616vxtHXn6NGjsXnz5oiIGB4ejrVr19qr/9Pd3R379u2LU6dORXt7e2zZsiVW\nr14d3/rWt+L48eN+9eP/vH+fvvnNb8a+ffvi4MGDUSgUYuHChfGd73zn4vecZqr9+/fHpk2b4vrr\nr79466+7uzuWLl3qmnqfy+3VfffdF7t27XJdvcff/va3eOCBB2JkZOTi93q/+tWvxqlTpyZ0TXmv\nZgBI5J2rACCR8AJAIuEFgETCCwCJhBcAEgkvACQSXgBIJLwAkOh/AEcfcOaQI0osAAAAAElFTkSu\nQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f50900c2d50>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cars.speed.hist(bins=20)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"cars['speed_over_distance'] = cars.speed / cars.dist"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f5089c80210>"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeUAAAFXCAYAAACcMlYcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEZ9JREFUeJzt3X1s1Xe9wPFPWddrS0vHw2lZGNvVThzEYFSyGDRiHAN1\nWy3uIdNkZk5BEyOLREkQ95cPJC5bouaaDKfRmVydycJSgwmJw7E/3Jgu4K6CITMLpblAgfJUHlIK\n5/6x3OVy5aHn11/hU87r9R/lfPf7nH755t1zDvzWUK1WqwEAXHWTrvYAAMBbRBkAkhBlAEhClAEg\nCVEGgCREGQCSuGSU16xZEwsXLox77rnn7a8dOXIkvvCFL8TSpUvjkUceiWPHjo37kABQDy4Z5Xvv\nvTeefvrp8762fv36WLhwYWzatCk+9KEPxfr168d1QACoF5eM8oIFC2LKlCnnfW3z5s2xbNmyiIhY\ntmxZ/OEPfxi/6QCgjtT8mfKhQ4dixowZERExY8aMOHToUOlDAUA9GtNf9GpoaIiGhoayZgGAutZY\n64Lp06fHgQMHolKpxMDAQEybNu2ya6rVqngXtGvXrnhozX9GS3vHqNecPDoQv1r3uZgzZ844TgZA\n2WqO8sc//vHYsGFDrFixIp5//vlYvHjxZdc0NDTEgQPHCw1Y7wYHh6KlvSNap86qeV1Z3/NKpc3+\nTVD2bmKzfxNXpdJWaN0l375etWpVPPjgg/Hmm2/GokWL4rnnnosVK1bEn/70p1i6dGm88sorsWLF\nikIXBgDOd8lXyk8++eQFv/6LX/xiPGYBgLrmjl4AkIQoA0ASogwASYgyACQhygCQhCgDQBKiDABJ\niDIAJCHKAJCEKANAEqIMAEmIMgAkIcoAkIQoA0ASogwASYgyACQhygCQhCgDQBKiDABJiDIAJCHK\nAJCEKANAEqIMAEmIMgAkIcoAkIQoA0ASogwASYgyACQhygCQhCgDQBKiDABJiDIAJCHKAJCEKANA\nEqIMA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LliwZc/dKe6U8mvthv/DCC7Fs2bKIiHjf+94Xx44di4MHD5Y1AgW5l/nEtmDB\ngpgyZcpFf9+5y+1y+0delUol5s6dGxERkydPjq6urhgYOP9uXrWev9KiPJr7YQ8MDMTMmTPf/vXM\nmTNj3759ZY1AQaPZu4aGhti2bVt0d3fH8uXL44033rjSY1KQczexOXsTQ39/f+zcuTPmz59/3tdr\nPX+Fbh5yIaO9H3b1//2z6GvpPtoT1Wj2YN68efHiiy9Gc3NzbNmyJb761a/Gpk2brsB0lMG5m7ic\nvfxOnDgRK1eujLVr18bkyZP/5fdrOX+lvVLu7OyMvXv3vv3rffv2RWdn53mP6ejoOO8nhAs9hitv\nNHvX2toazc3NERGxaNGiOHPmTBw5cuSKzkkxzt3E5uzldubMmVi5cmV0d3fH4sWL/+X3az1/pUV5\nNPfDvuOOO+L555+PiLf+pxZTpkyJGTNmlDUCBY1m7w4ePPj2T3uvv/56RETccMMNV3xWaufcTWzO\nXl7VajXWrl0bXV1d8fDDD1/wMbWev9Levr7Y/bB/85vfRETEgw8+GIsWLYotW7bEnXfeGc3NzbFu\n3bqyLs8YjGbvNm3aFL/+9a/juuuui+bm5njyySev8tT8r1WrVsWrr74aR44ciUWLFsXXvva1GBkZ\niQjnbiK43P45e3m99tpr0dvbG+95z3uip6cnIiK+/vWvv/3OY5Hz597XAJCEO3oBQBKiDABJiDIA\nJCHKAJCEKANAEqIMAEmIMgAkIcoAkMT/AG2MBhflVwyzAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f509c4e5e50>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cars.speed_over_distance.hist(bins=30)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Pass the altered cars dataset back from Python to R "
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%R -i cars"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"'data.frame':\t50 obs. of 3 variables:\n",
" $ speed : num [1:50(1d)] 4 4 7 7 8 9 10 10 10 11 ...\n",
" $ dist : num [1:50(1d)] 2 10 4 22 16 10 18 26 34 17 ...\n",
" $ speed_over_distance: num [1:50(1d)] 2 0.4 1.75 0.318 0.5 ...\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%R\n",
"str(cars)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAHgCAMAAABKCk6nAAACPVBMVEUAAAAGBgYHBwcJCQkLCwsM\nDAwODg4PDw8QEBARERESEhITExMUFBQVFRUWFhYXFxcYGBgZGRkbGxscHBwdHR0eHh4fHx8hISEi\nIiIjIyMlJSUmJiYoKCgpKSkrKyssLCwuLi4vLy8zMzM1NTU6Ojo8PDxDQ0NERERHR0dKSkpLS0tM\nTExNTU1OTk5PT09QUFBRUVFTU1NUVFRYWFhZWVlaWlpbW1tcXFxdXV1eXl5fX19gYGBhYWFjY2Nk\nZGRlZWVoaGhra2ttbW1ubm5wcHBxcXF1dXV3d3d5eXl8fHx9fX1/f3+AgICBgYGCgoKDg4OEhISG\nhoaHh4eIiIiJiYmKioqLi4uMjIyNjY2Ojo6Pj4+QkJCRkZGUlJSVlZWWlpaXl5eYmJiZmZmampqb\nm5ucnJydnZ2enp6goKChoaGioqKjo6OkpKSlpaWmpqanp6eoqKipqamqqqqrq6usrKytra2urq6v\nr6+wsLCxsbGysrKzs7O0tLS1tbW2tra3t7e4uLi6urq7u7u9vb2+vr7AwMDBwcHCwsLDw8PFxcXG\nxsbIyMjKysrLy8vMzMzNzc3Ozs7Pz8/Q0NDS0tLT09PU1NTV1dXW1tbX19fY2NjZ2dna2trc3Nzd\n3d3e3t7f39/g4ODh4eHj4+Pk5OTl5eXm5ubn5+fo6Ojp6enq6urr6+vs7Ozt7e3u7u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_type": "display_data"
}
],
"source": [
"%%R\n",
"qplot(cars$speed_over_distance, binwidth = 0.05)"
]
}
],
"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.10"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment