From 6dbded2352430e51481ac1fca1f07875c0ee3685 Mon Sep 17 00:00:00 2001 From: stonebig Date: Sat, 22 Apr 2017 21:00:25 +0200 Subject: [PATCH 1/2] ignore FutureWarning too --- docs/Winpython_checker.ipynb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/Winpython_checker.ipynb b/docs/Winpython_checker.ipynb index 143788f..4c35bfb 100644 --- a/docs/Winpython_checker.ipynb +++ b/docs/Winpython_checker.ipynb @@ -18,6 +18,7 @@ "import warnings\n", "warnings.filterwarnings(\"ignore\", category=DeprecationWarning)\n", "warnings.filterwarnings(\"ignore\", category=UserWarning)\n", + "warnings.filterwarnings(\"ignore\", category=FutureWarning)\n", "# warnings.filterwarnings(\"ignore\") # would silence all warnings" ] }, @@ -294,9 +295,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Holoviews \n", From d7ef34cb0cd45d285f57ac829e36a5b10d6b9fb5 Mon Sep 17 00:00:00 2001 From: stonebig Date: Mon, 1 Jan 2018 20:35:30 +0100 Subject: [PATCH 2/2] R-efresh --- docs/Winpython_checker.ipynb | 269 ++++++++++++++----------- docs/installing_R.ipynb | 379 +++++++++++++++++------------------ 2 files changed, 338 insertions(+), 310 deletions(-) diff --git a/docs/Winpython_checker.ipynb b/docs/Winpython_checker.ipynb index 4c35bfb..fb436ee 100644 --- a/docs/Winpython_checker.ipynb +++ b/docs/Winpython_checker.ipynb @@ -10,9 +10,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "import warnings\n", @@ -25,9 +23,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "%matplotlib inline" @@ -50,9 +46,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# checking Numba JIT toolchain\n", @@ -121,9 +115,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Cython + Mingwpy compiler toolchain test\n", @@ -169,7 +161,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Graphics: Matplotlib, Pandas, Seaborn, bqplot, Bokeh, Holoviews" + "## Graphics: Matplotlib, Pandas, Seaborn, Holoviews, Bokeh, bqplot, ipyleaflet, plotnine" ] }, { @@ -216,6 +208,116 @@ "sns.pairplot(df, hue=\"species\", size=1.5)" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# altair 1.3 example\n", + "import altair as at\n", + "at.Chart(df).mark_bar().encode(\n", + " x=at.X('sepal_length', bin=at.Bin(maxbins=50)),\n", + " y='count(*):Q',\n", + " color='species:N',\n", + " # column='species',\n", + ").configure_cell(width=200)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Holoviews\n", + "# for more example, see http://holoviews.org/Tutorials/index.html\n", + "import numpy as np\n", + "import holoviews as hv\n", + "hv.extension('matplotlib')\n", + "dots = np.linspace(-0.45, 0.45, 11)\n", + "fractal = hv.Image(image)\n", + "\n", + "layouts = {y: (fractal * hv.Points(fractal.sample([(i,y) for i in dots])) +\n", + " fractal.sample(y=y) )\n", + " for y in np.linspace(0, 0.45,11)}\n", + "\n", + "hv.HoloMap(layouts, kdims=['Y']).collate().cols(2)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Bokeh 0.12.5 \n", + "import numpy as np\n", + "from six.moves import zip\n", + "from bokeh.plotting import figure, show, output_notebook\n", + "N = 4000\n", + "x = np.random.random(size=N) * 100\n", + "y = np.random.random(size=N) * 100\n", + "radii = np.random.random(size=N) * 1.5\n", + "colors = [\"#%02x%02x%02x\" % (int(r), int(g), 150) for r, g in zip(50+2*x, 30+2*y)]\n", + "\n", + "output_notebook()\n", + "TOOLS=\"hover,crosshair,pan,wheel_zoom,box_zoom,reset,tap,save,box_select,poly_select,lasso_select\"\n", + "\n", + "p = figure(tools=TOOLS)\n", + "p.scatter(x,y, radius=radii, fill_color=colors, fill_alpha=0.6, line_color=None)\n", + "show(p)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Datashader (holoviews+Bokeh)\n", + "import numpy as np\n", + "import pandas as pd\n", + "import holoviews as hv\n", + "import datashader as ds\n", + "from holoviews.operation.datashader import aggregate, shade, datashade, dynspread\n", + "from bokeh.models import DatetimeTickFormatter\n", + "hv.extension('bokeh')\n", + "\n", + "def time_series(T = 1, N = 100, mu = 0.1, sigma = 0.1, S0 = 20): \n", + " \"\"\"Parameterized noisy time series\"\"\"\n", + " dt = float(T)/N\n", + " t = np.linspace(0, T, N)\n", + " W = np.random.standard_normal(size = N) \n", + " W = np.cumsum(W)*np.sqrt(dt) # standard brownian motion\n", + " X = (mu-0.5*sigma**2)*t + sigma*W \n", + " S = S0*np.exp(X) # geometric brownian motion\n", + " return S\n", + "\n", + "def apply_formatter(plot, element):\n", + " plot.handles['xaxis'].formatter = DatetimeTickFormatter()\n", + " \n", + "drange = pd.date_range(start=\"2014-01-01\", end=\"2016-01-01\", freq='1D') # or '1min'\n", + "dates = drange.values.astype('int64')/10**6 # Convert dates to ints\n", + "curve = hv.Curve((dates, time_series(N=len(dates), sigma = 1)))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%opts RGB [finalize_hooks=[apply_formatter] width=800]\n", + "%%opts Overlay [finalize_hooks=[apply_formatter] width=800] \n", + "%%opts Scatter [tools=['hover', 'box_select']] (line_color=\"black\" fill_color=\"red\" size=10)\n", + "\n", + "from holoviews.operation.timeseries import rolling, rolling_outlier_std\n", + "smoothed = rolling(curve, rolling_window=50)\n", + "outliers = rolling_outlier_std(curve, rolling_window=50, sigma=2)\n", + "datashade(curve, cmap=[\"blue\"]) * dynspread(datashade(smoothed, cmap=[\"red\"]),max_px=1) * outliers" + ] + }, { "cell_type": "code", "execution_count": null, @@ -259,9 +361,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "dc.on_draw(handle_draw)\n", @@ -274,37 +374,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Bokeh 0.12.5 \n", - "import numpy as np\n", - "from six.moves import zip\n", - "from bokeh.plotting import figure, show, output_notebook\n", - "N = 4000\n", - "x = np.random.random(size=N) * 100\n", - "y = np.random.random(size=N) * 100\n", - "radii = np.random.random(size=N) * 1.5\n", - "colors = [\"#%02x%02x%02x\" % (int(r), int(g), 150) for r, g in zip(50+2*x, 30+2*y)]\n", - "\n", - "output_notebook()\n", - "TOOLS=\"hover,crosshair,pan,wheel_zoom,box_zoom,reset,tap,save,box_select,poly_select,lasso_select\"\n", - "\n", - "p = figure(tools=TOOLS)\n", - "p.scatter(x,y, radius=radii, fill_color=colors, fill_alpha=0.6, line_color=None)\n", - "show(p)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Holoviews \n", - "# for more example, see http://holoviews.org/Tutorials/index.html\n", - "import holoviews as hv\n", - "%load_ext holoviews.ipython\n", - "fractal = hv.Image(image)\n", - "\n", - "((fractal * hv.HLine(y=0.16)).hist() + fractal.sample(y=0.16))" + "# plotnine: giving a taste of ggplot of R langage (formerly we were using ggpy)\n", + "from plotnine import ggplot, aes, geom_blank, geom_point, stat_smooth, facet_wrap, theme_bw\n", + "from plotnine.data import mtcars\n", + "ggplot(mtcars, aes(x='hp', y='wt', color='mpg')) + geom_point() +\\\n", + "facet_wrap(\"~cyl\") + theme_bw()" ] }, { @@ -317,9 +391,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "import IPython;IPython.__version__" @@ -328,9 +400,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Audio Example : https://github.com/ipython/ipywidgets/blob/master/examples/Beat%20Frequencies.ipynb\n", @@ -354,9 +424,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Networks graph Example : https://github.com/ipython/ipywidgets/blob/master/examples/Exploring%20Graphs.ipynb\n", @@ -395,9 +463,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# checking nbconvert \n", @@ -407,9 +473,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "%%HTML\n", @@ -426,9 +490,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# checking statsmodels\n", @@ -458,9 +520,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# lmfit test (from http://nbviewer.ipython.org/github/lmfit/lmfit-py/blob/master/examples/lmfit-model.ipynb)\n", @@ -489,9 +549,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "#Pandas \n", @@ -518,9 +576,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "datas.query('Measure > 0').groupby(['Color','Year']).size().unstack()" @@ -536,9 +592,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# checking Web Scraping: beautifulsoup and requests \n", @@ -575,7 +629,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": true, "scrolled": true }, "outputs": [], @@ -623,9 +676,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Checking Theano\n", @@ -648,9 +699,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# checking sympy \n", @@ -670,9 +719,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# checking Ipython-sql, sqlparse, SQLalchemy\n", @@ -682,9 +729,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "%%sql sqlite:///.baresql.db\n", @@ -698,9 +743,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# checking baresql\n", @@ -718,9 +761,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Transfering Datas to sqlite, doing transformation in sql, going back to Pandas and Matplotlib\n", @@ -735,9 +776,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# checking db.py\n", @@ -749,9 +788,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "db.tables" @@ -760,9 +797,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# checking sqlite_bro: this should lanch a separate non-browser window with sqlite_bro's welcome\n", @@ -772,9 +807,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# pyodbc \n", @@ -790,9 +823,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# pythonnet\n", @@ -829,9 +860,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# optional scipy full test (takes up to 10 minutes)\n", @@ -841,11 +870,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], - "source": [] + "source": [ + "!pip list" + ] } ], "metadata": { @@ -864,7 +893,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.3" + "version": "3.6.3" }, "widgets": { "state": { @@ -901,5 +930,5 @@ } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 2 } diff --git a/docs/installing_R.ipynb b/docs/installing_R.ipynb index dfa69bc..73ae60b 100644 --- a/docs/installing_R.ipynb +++ b/docs/installing_R.ipynb @@ -7,62 +7,47 @@ "# Installating R on WinPython\n", "\n", "#### This procedure applys for Winpython (Version of December 2015 and after) \n", - "### 1 - Downloading and Installing R binary in the right place" + "### 1 - Downloading R binary" ] }, { "cell_type": "code", "execution_count": 1, - "metadata": { - "collapsed": false - }, - "outputs": [], + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Le volume dans le lecteur C n'a pas de nom.\n", + " Le num‚ro de s‚rie du volume est 98F9-A53D\n", + "\n", + " R‚pertoire de C:\\WinPython\\basedir36\\buildQt5\\winpython-64bit-3.6.x.0\\tools\n", + "\n", + "01/01/2018 20:12 82ÿ374ÿ679 R-3.4.3-win.exe\n", + " 1 fichier(s) 82ÿ374ÿ679 octets\n", + " 0 R‚p(s) 27ÿ286ÿ278ÿ144 octets libres\n" + ] + } + ], "source": [ "import os\n", "import sys\n", - "import io" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "os.environ[\"tmp_Rdirectory\"]= \"R\" \n", - "os.environ[\"R_HOME\"] = os.environ[\"WINPYDIR\"]+ \"\\\\..\\\\tools\\\\R\\\\\" \n", - "os.environ[\"R_HOMEbin\"]=os.environ[\"R_HOME\"] + \"bin\" \n", - "# for installation we need this\n", - "os.environ[\"tmp_Rbase\"]=os.path.join(os.path.split(os.environ[\"WINPYDIR\"])[0] , 'tools','R' ) " - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "# downloading R-3.2.3 (65 380 480 Bytes, may takes a few minutes)\n", + "import io\n", + "\n", + "# downloading R may takes a few minutes (80Mo)\n", "try:\n", " import urllib.request as urllib2 # Python 3\n", "except:\n", " import urllib2 # Python 2\n", - "if 'amd64' in sys.version.lower():\n", - " r_comp ='/COMPONENTS=\"main,x64,translations'\n", - "else:\n", - " r_comp ='/COMPONENTS=\"main,i386,translations'\n", "\n", - "# specify R binary and hash\n", - "r_url = \"https://cran.r-project.org/bin/windows/base/R-3.3.1-win.exe\"\n", - "hashes=(\"104bfc769d27c3fd3c9294cc4f82e232\", \"b1102b40c08914bada8f3240197ac960070c7db2\" )\n", + "# specify R binary and (md5, sha1) hash\n", + "# R-3.4.3:\n", + "r_url = \"https://cran.r-project.org/bin/windows/base/R-3.4.3-win.exe\"\n", + "hashes=(\"0ff087acbae677d7255af19b0a9df27f\",\"aabf0b671ae1dca741c3df9dee976a7d4b584f80\")\n", "\n", "# specify target location\n", - "r_binary = os.path.basename(r_url)\n", - "r_installer = os.environ[\"WINPYDIR\"]+\"\\\\..\\\\tools\\\\\"+r_binary\n", + "r_installer = os.environ[\"WINPYDIR\"]+\"\\\\..\\\\tools\\\\\"+os.path.basename(r_url)\n", "os.environ[\"r_installer\"] = r_installer\n", "\n", "# Download\n", @@ -70,42 +55,24 @@ "with io.open(r_installer, 'wb') as f:\n", " f.write(g.read())\n", "g.close\n", - "g = None" + "g = None\n", + "\n", + "#checking it's there\n", + "!dir %r_installer%" ] }, { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " Le volume dans le lecteur C n'a pas de nom.\n", - " Le num‚ro de s‚rie du volume est 98F9-A53D\n", - "\n", - " R‚pertoire de C:\\WinPython\\basedir35\\buildQt5\\winpython-64bit-3.5.2.3Qt5b2\\tools\n", - "\n", - "04/10/2016 19:52 73ÿ566ÿ547 R-3.3.1-win.exe\n", - " 1 fichier(s) 73ÿ566ÿ547 octets\n", - " 0 R‚p(s) 30ÿ744ÿ125ÿ440 octets libres\n" - ] - } - ], + "cell_type": "markdown", + "metadata": {}, "source": [ - "#checking it's there\n", - "!dir %r_installer%" + "\n", + "### 2 - checking and Installing R binary in the right place" ] }, { "cell_type": "code", - "execution_count": 5, - "metadata": { - "collapsed": false - }, + "execution_count": 7, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -113,35 +80,58 @@ "text": [ " MD5 SHA-1 \n", "-------------------------------- ----------------------------------------\n", - "104bfc769d27c3fd3c9294cc4f82e232 b1102b40c08914bada8f3240197ac960070c7db2 C:\\WinPython\\basedir35\\buildQt5\\winpython-64bit-3.5.2.3Qt5b2\\scripts\\..\\python-3.5.2.amd64\\..\\tools\\R-3.3.1-win.exe\n" + "0ff087acbae677d7255af19b0a9df27f aabf0b671ae1dca741c3df9dee976a7d4b584f80 C:\\WinPython\\basedir36\\buildQt5\\winpython-64bit-3.6.x.0\\python-3.6.4.amd64\\..\\tools\\R-3.4.3-win.exe\n", + "looks good!\n" ] } ], "source": [ - "# checking it's the official R-3.2.3 \n", + "# checking it's the official R\n", "import hashlib\n", "def give_hash(of_file, with_this):\n", " with io.open(r_installer, 'rb') as f:\n", " return with_this(f.read()).hexdigest() \n", "print (\" \"*12+\"MD5\"+\" \"*(32-12-3)+\" \"+\" \"*15+\"SHA-1\"+\" \"*(40-15-5)+\"\\n\"+\"-\"*32+\" \"+\"-\"*40)\n", - "\n", "print (\"%s %s %s\" % (give_hash(r_installer, hashlib.md5) , give_hash(r_installer, hashlib.sha1),r_installer))\n", - "assert give_hash(r_installer, hashlib.md5) == hashes[0]\n", - "assert give_hash(r_installer, hashlib.sha1) == hashes[1]" + "if give_hash(r_installer, hashlib.md5) == hashes[0] and give_hash(r_installer, hashlib.sha1) == hashes[1]:\n", + " print(\"looks good!\")\n", + "else:\n", + " print(\"problem ! please check\")\n", + " assert give_hash(r_installer, hashlib.md5) == hashes[0]\n", + " assert give_hash(r_installer, hashlib.sha1) == hashes[1]" ] }, { "cell_type": "code", - "execution_count": 6, - "metadata": { - "collapsed": false - }, + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "# preparing Dos variables\n", + "os.environ[\"R_HOME\"] = os.environ[\"WINPYDIR\"]+ \"\\\\..\\\\tools\\\\R\\\\\" \n", + "os.environ[\"R_HOMEbin\"]=os.environ[\"R_HOME\"] + \"bin\" \n", + "\n", + "# for installation we need this\n", + "os.environ[\"tmp_Rbase\"]=os.path.join(os.path.split(os.environ[\"WINPYDIR\"])[0] , 'tools','R' ) \n", + "if 'amd64' in sys.version.lower():\n", + " r_comp ='/COMPONENTS=\"main,x64,translations'\n", + "else:\n", + " r_comp ='/COMPONENTS=\"main,i386,translations'\n", + "os.environ[\"tmp_R_comp\"]=r_comp\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, "outputs": [], "source": [ - "# let's install it \n", + "# let's install it, if hashes do match\n", + "assert give_hash(r_installer, hashlib.md5) == hashes[0]\n", + "assert give_hash(r_installer, hashlib.sha1) == hashes[1]\n", "# If you are \"USB life style\", or multi-winpython\n", "# ==> CLICK the OPTION \"Don't create a StartMenuFolder' <== (when it will show up)\n", - "os.environ[\"tmp_R_comp\"]=r_comp\n", + "\n", "!start cmd /C %r_installer% /DIR=%tmp_Rbase% %tmp_R_comp%" ] }, @@ -171,15 +161,13 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### 2 - create a R_launcher and install irkernel" + "### 3 - create a R_launcher and install irkernel" ] }, { "cell_type": "code", - "execution_count": 7, - "metadata": { - "collapsed": false - }, + "execution_count": 10, + "metadata": {}, "outputs": [], "source": [ "import os\n", @@ -217,16 +205,14 @@ }, { "cell_type": "code", - "execution_count": 2, - "metadata": { - "collapsed": false - }, + "execution_count": 11, + "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "!start cmd /C %WINPYDIR%\\..\\scripts\\R_launcher.bat --no-restore --no-save C:\\WinPython\\basedir35\\buildQt5\\winpython-64bit-3.5.2.3Qt5b2\\scripts\\R_initialization.r\n" + "!start cmd /C %WINPYDIR%\\..\\scripts\\R_launcher.bat --no-restore --no-save C:\\WinPython\\basedir36\\buildQt5\\winpython-64bit-3.6.x.0\\scripts\\R_initialization.r\n" ] } ], @@ -237,10 +223,8 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, + "execution_count": 12, + "metadata": {}, "outputs": [], "source": [ "# Launch Rkernel setup\n", @@ -250,16 +234,14 @@ }, { "cell_type": "code", - "execution_count": 8, - "metadata": { - "collapsed": false - }, + "execution_count": 13, + "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "patching C:\\WinPython\\basedir35\\buildQt5\\winpython-64bit-3.5.2.3Qt5b2\\settings\\kernels\\ir\\kernel.json from C:/WinPython/basedir35/buildQt5/winpython-64bit-3.5.2.3Qt5b2 to {prefix}/..\n" + "patching C:\\WinPython\\basedir36\\buildQt5\\winpython-64bit-3.6.x.0\\settings\\kernels\\ir\\kernel.json from C:/WinPython/basedir36/buildQt5/winpython-64bit-3.6.x.0 to {prefix}/..\n" ] } ], @@ -275,19 +257,15 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": false - }, + "metadata": {}, "source": [ - "### 3- Install a R package via a IPython Kernel" + "### 4- Install a R package via a IPython Kernel" ] }, { "cell_type": "code", - "execution_count": 9, - "metadata": { - "collapsed": false - }, + "execution_count": 14, + "metadata": {}, "outputs": [], "source": [ "%load_ext rpy2.ipython\n", @@ -301,15 +279,13 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### 4- Small demo via R magic" + "### 5- Small demo via R magic" ] }, { "cell_type": "code", - "execution_count": 10, - "metadata": { - "collapsed": false - }, + "execution_count": 15, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -326,10 +302,8 @@ }, { "cell_type": "code", - "execution_count": 11, - "metadata": { - "collapsed": false - }, + "execution_count": 16, + "metadata": {}, "outputs": [], "source": [ "%%R\n", @@ -340,15 +314,26 @@ }, { "cell_type": "code", - "execution_count": 12, - "metadata": { - "collapsed": false - }, + "execution_count": 17, + "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", + "\n", "\n", " \n", " \n", @@ -537,7 +522,7 @@ "6 719.0 5.0 58.0 1.357016e+09 " ] }, - "execution_count": 12, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -548,15 +533,26 @@ }, { "cell_type": "code", - "execution_count": 13, - "metadata": { - "collapsed": false - }, + "execution_count": 18, + "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", + "\n", "
\n", " \n", " \n", @@ -568,99 +564,106 @@ " \n", " \n", " \n", + " \n", " \n", " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", + " \n", + " \n", " \n", " \n", "
alttzdsttzonedest
1IAHGeorge Bush Intercontinental29.984433-95.34144297-6.0ABQAlbuquerque International Sunport35.040222-106.6091945355-7.0AIAHAmerica/DenverABQ
2MIAMiami Intl25.793250-80.2905568ACKNantucket Mem41.253053-70.06018148-5.0AMIAAmerica/New_YorkACK
3ATLHartsfield Jackson Atlanta Intl33.636719-84.4280671026ALBAlbany Intl42.748267-73.801692285-5.0AATLAmerica/New_YorkALB
4ORDChicago Ohare Intl41.978603-87.904842668-6.0ANCTed Stevens Anchorage Intl61.174361-149.996361152-9.0AORDAmerica/AnchorageANC
5FLLFort Lauderdale Hollywood Intl26.072583-80.1527509ATLHartsfield Jackson Atlanta Intl33.636719-84.4280671026-5.0AFLLAmerica/New_YorkATL
6IADWashington Dulles Intl38.944533-77.455811313-5.0AUSAustin Bergstrom Intl30.194528-97.669889542-6.0AIADAmerica/ChicagoAUS
\n", "
" ], "text/plain": [ - " faa name lat lon alt tz dst \\\n", - "1 IAH George Bush Intercontinental 29.984433 -95.341442 97 -6.0 A \n", - "2 MIA Miami Intl 25.793250 -80.290556 8 -5.0 A \n", - "3 ATL Hartsfield Jackson Atlanta Intl 33.636719 -84.428067 1026 -5.0 A \n", - "4 ORD Chicago Ohare Intl 41.978603 -87.904842 668 -6.0 A \n", - "5 FLL Fort Lauderdale Hollywood Intl 26.072583 -80.152750 9 -5.0 A \n", - "6 IAD Washington Dulles Intl 38.944533 -77.455811 313 -5.0 A \n", + " faa name lat lon alt tz \\\n", + "1 ABQ Albuquerque International Sunport 35.040222 -106.609194 5355 -7.0 \n", + "2 ACK Nantucket Mem 41.253053 -70.060181 48 -5.0 \n", + "3 ALB Albany Intl 42.748267 -73.801692 285 -5.0 \n", + "4 ANC Ted Stevens Anchorage Intl 61.174361 -149.996361 152 -9.0 \n", + "5 ATL Hartsfield Jackson Atlanta Intl 33.636719 -84.428067 1026 -5.0 \n", + "6 AUS Austin Bergstrom Intl 30.194528 -97.669889 542 -6.0 \n", "\n", - " dest \n", - "1 IAH \n", - "2 MIA \n", - "3 ATL \n", - "4 ORD \n", - "5 FLL \n", - "6 IAD " + " dst tzone dest \n", + "1 A America/Denver ABQ \n", + "2 A America/New_York ACK \n", + "3 A America/New_York ALB \n", + "4 A America/Anchorage ANC \n", + "5 A America/New_York ATL \n", + "6 A America/Chicago AUS " ] }, - "execution_count": 13, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -673,15 +676,13 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### 5 - Installing the very best of R pakages (optional, you will start to get a really big directory)\n" + "### 6 - Installing the very best of R pakages (optional, you will start to get a really big directory)\n" ] }, { "cell_type": "code", - "execution_count": 14, - "metadata": { - "collapsed": true - }, + "execution_count": 19, + "metadata": {}, "outputs": [], "source": [ "# essentials: 'tidyr', 'shiny', 'ggplot2', 'caret' , 'nnet' \n", @@ -697,7 +698,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### 6 - Relaunch Jupyter Notebook to get a R kernel option\n", + "### 7 - Relaunch Jupyter Notebook to get a R kernel option\n", "launch a new notebook of \"R\" type, and type in it:\n", " \n", "library('dplyr')\n", @@ -723,9 +724,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [] } @@ -746,9 +745,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.2" + "version": "3.6.4" } }, "nbformat": 4, - "nbformat_minor": 0 + "nbformat_minor": 1 }