{"id":282069,"date":"2016-12-06T15:05:04","date_gmt":"2016-12-06T12:05:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=282069"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=282069","title":{"rendered":"\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 Jupyter Notebook, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b (\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c) \u043d\u0435 \u0441\u043b\u044b\u0448\u0430\u043b\u0438"},"content":{"rendered":"<p>Jupyter Notebook \u2013 \u044d\u0442\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0445 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0442\u0447\u0435\u0442\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u043a\u043e\u0434, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0438:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/15f\/720\/7f7\/15f7207f72e64f4192320b0bb2544664.png\"\/><\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u0438\u0448\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 Jupyter \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0443\u0442\u044b\u043c. \u041e \u043d\u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445, \u043d\u043e \u0435\u0441\u043b\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u0442\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0438 \u043d\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0448\u044c.<\/p>\n<p>  <a name=\"habracut\"><\/a><br \/>  Jupyter \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u043f\u043e ssh \u0438\u043b\u0438 http. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u044d\u0442\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0435 \u041f\u041e.<br \/>  <habracut\/>  <\/p>\n<h2>\u041e\u0441\u043d\u043e\u0432\u044b<\/h2>\n<p>  \u0421\u043f\u0438\u0441\u043e\u043a \u0445\u043e\u0442\u043a\u0435\u0435\u0432 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0432 Help &gt; Keyboard Shortcuts (\u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u0441\u0442\u0435\u0441\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u0437\u0430\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u0441\u043d\u043e\u0432\u0430).<\/p>\n<p>  \u041e\u0442\u0441\u044e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441 \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u043e\u043c (notebook). \u0415\u0441\u043b\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c c Jupyter, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0439 \u0432\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u0432\u044b\u0443\u0447\u0438\u0442\u0435.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,<\/p>\n<ul>\n<li><code>Esc + F<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u0439\u0442\u0438 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u0434\u0435, \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0432\u044b\u0432\u043e\u0434;<\/li>\n<li><code>Esc + O<\/code> \u2014 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u044b\u0432\u043e\u0434 \u044f\u0447\u0435\u0439\u043a\u0438;<\/li>\n<li>\u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0447\u0435\u0435\u043a \u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c\/\u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\/\u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c\/\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c. \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u0438 \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u0430.<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d76\/ba1\/82d\/d76ba182d9904e1ca176fb82e5cf36e0.png\"\/><\/p>\n<h2>\u042d\u043a\u0441\u043f\u043e\u0440\u0442 \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u0430<\/h2>\n<p>  \u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u2014 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0431\u043b\u043e\u043a\u043d\u043e\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 IPython Notebook (.ipynb), \u043d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043d\u0435 \u0432\u0441\u0435, \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043b\u043e\u043a\u043d\u043e\u0442 \u0432 html-\u0444\u0430\u0439\u043b;<\/li>\n<li>\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 <a href=\"https:\/\/gist.github.com\/\">gists<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043c\u0435\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u044d\u0442\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 (<a href=\"https:\/\/gist.github.com\/arogozhnikov\/930f5663a63014e773d9\">\u0441\u043c. \u043f\u0440\u0438\u043c\u0435\u0440<\/a>);<\/li>\n<li>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0430\u0448 \u0431\u043b\u043e\u043a\u043d\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 dropbox, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u0432 <a href=\"http:\/\/nbviewer.jupyter.org\/\">nbviewer<\/a>;<\/li>\n<li>\u0411\u043b\u043e\u043a\u043d\u043e\u0442\u044b \u0443\u043c\u0435\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c github (\u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442), \u0447\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f (\u0435\u0441\u043b\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0448\u0438\u0440\u043e\u043a\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0435).<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432<\/h2>\n<p>  \u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432:<\/p>\n<ul>\n<li>matplotlib (\u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0441\u0442\u0430\u0440\u0434\u0430\u0440\u0442), \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>%matplotlib inline<\/code>;<\/li>\n<li><code>%matplotlib notebook<\/code> \u2014 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c, \u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430;<\/li>\n<li>mpld3 \u2014 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0430\u044f D3) \u0434\u043b\u044f matplotlib. \u041e\u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u0430, \u0445\u043e\u0442\u044f \u0438 \u043d\u0435\u043f\u043e\u043b\u043d\u0430.<\/li>\n<li>bokeh \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432;<\/li>\n<li>plot.ly \u0441\u0442\u0440\u043e\u0438\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438, \u043d\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u043e\u0438\u0442\u044c \u0434\u0435\u043d\u0435\u0433.<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4ec\/5c0\/66e\/4ec5c066e18648c397ae5c539f41970a.png\"\/><\/p>\n<h2>Magic-\u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/h2>\n<p>  \u041c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b (magics) \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 python \u0432 <i>\u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 python<\/i>. Magic-\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u2014 \u044d\u0442\u043e \u043a\u043b\u044e\u0447 \u043a \u043c\u043e\u0433\u0443\u0449\u0435\u0441\u0442\u0432\u0443 IPython&#8217;\u0430.  <\/p>\n<pre><code class=\"python\"># list available python magics %lsmagic<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">Available line magics: %alias  %alias_magic  %autocall  %automagic  %autosave  %bookmark  %cat  %cd  %clear  %colors  %config  %connect_info  %cp  %debug  %dhist  %dirs  %doctest_mode  %ed  %edit  %env  %gui  %hist  %history  %killbgscripts  %ldir  %less  %lf  %lk  %ll  %load  %load_ext  %loadpy  %logoff  %logon  %logstart  %logstate  %logstop  %ls  %lsmagic  %lx  %macro  %magic  %man  %matplotlib  %mkdir  %more  %mv  %notebook  %page  %pastebin  %pdb  %pdef  %pdoc  %pfile  %pinfo  %pinfo2  %popd  %pprint  %precision  %profile  %prun  %psearch  %psource  %pushd  %pwd  %pycat  %pylab  %qtconsole  %quickref  %recall  %rehashx  %reload_ext  %rep  %rerun  %reset  %reset_selective  %rm  %rmdir  %run  %save  %sc  %set_env  %store  %sx  %system  %tb  %time  %timeit  %unalias  %unload_ext  %who  %who_ls  %whos  %xdel  %xmode  Available cell magics: %%!  %%HTML  %%SVG  %%bash  %%capture  %%debug  %%file  %%html  %%javascript  %%js  %%latex  %%perl  %%prun  %%pypy  %%python  %%python2  %%python3  %%ruby  %%script  %%sh  %%svg  %%sx  %%system  %%time  %%timeit  %%writefile  Automagic is ON, % prefix IS NOT needed for line magics.<\/code><\/pre>\n<p>  <\/p>\n<h2>%env<\/h2>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u044b \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u0430 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 Jupyter-\u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 (\u0442\u0430\u043a\u0438\u0435, \u043a\u0430\u043a theano) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0438 %env \u2014 \u0441\u0430\u043c\u044b\u0439 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431.<\/p>\n<pre><code class=\"python\">#%env - without arguments lists environmental variables %env OMP_NUM_THREADS=4<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">env: OMP_NUM_THREADS=4<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 shell-\u043a\u043e\u043c\u0430\u043d\u0434<\/h2>\n<p>  \u0412 Notebook \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e shell-\u043a\u043e\u043c\u0430\u043d\u0434\u0443. \u042d\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u043e\u0439.<\/p>\n<pre><code class=\"python\">!pip install numpy !pip list | grep Theano<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">Requirement already satisfied (use --upgrade to upgrade): numpy in \/Users\/axelr\/.venvs\/rep\/lib\/python2.7\/site-packages Theano (0.8.2)<\/code><\/pre>\n<p>  <\/p>\n<h2>\u041f\u043e\u0434\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0438<\/h2>\n<p>  \u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u044b\u0432\u043e\u0434 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 pass \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0438\u043b\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u0447\u043a\u0443 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"python\">%matplotlib inline from matplotlib import pyplot as plt import numpy<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># if you don't put semicolon at the end, you'll have output of function printed plt.hist(numpy.linspace(0, 1, 1000)**1.5);<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/bf0\/f29\/195\/bf0f291950854523b53815b0ba8d8bf5.png\"\/><\/p>\n<h2>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439\/\u043a\u043b\u0430\u0441\u0441\u043e\u0432\/\u0447\u0435\u0433\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u0430 (?, ??)<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\">from sklearn.cross_validation import train_test_split # show the sources of train_test_split function in the pop-up window train_test_split??<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># you can use ? to get details about magics, for instance: %pycat?<\/code><\/pre>\n<p>  \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u043e\u043a\u043d\u043e:<\/p>\n<pre><code class=\"bash\">Show a syntax-highlighted file through a pager.  This magic is similar to the cat utility, but it will assume the file to be Python source and will show it with syntax highlighting.  This magic command can either take a local filename, an url, an history range (see %history) or a macro as argument ::  %pycat myscript.py %pycat 7-27 %pycat myMacro %pycat http:\/\/www.example.com\/myscript.py<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 %run \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 Python<\/h2>\n<p>  %run \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c .py \u2014 \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e.<\/p>\n<p>  \u041d\u043e \u044d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u044b \u0438\u0437 Jupyter! \u0418\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e.<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e %run \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u043e \u0436\u0435, \u0447\u0442\u043e \u0438\u043c\u043f\u043e\u0440\u0442 python-\u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<pre><code class=\"python\"># this will execute all the code cells from different notebooks %run .\/2015-09-29-NumpyTipsAndTricks1.ipynb<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">[49 34 49 41 59 45 30 33 34 57] [172 177 209 197 171 176 209 208 166 151] [30 33 34 34 41 45 49 49 57 59] [209 208 177 166 197 176 172 209 151 171] [1 0 4 8 6 5 2 9 7 3] ['a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j'] ['b' 'a' 'e' 'i' 'g' 'f' 'c' 'j' 'h' 'd'] ['a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j'] [1 0 6 9 2 5 4 8 3 7] [1 0 6 9 2 5 4 8 3 7] [ 0.93551212  0.75079687  0.87495146  0.3344709   0.99628591  0.34355057   0.90019059  0.88272132  0.67272068  0.24679158] [8 4 5 1 9 2 7 6 3 0]<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0d0\/c57\/07a\/0d0c5707a6e3430a931eabb606178560.png\"\/><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/378\/7b9\/101\/3787b91017cd4718ace385a4f9da019d.png\"\/><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/565\/0cf\/c08\/5650cfc086f04cb18b963481bdf0cb79.png\"\/><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/207\/f21\/cfc\/207f21cfc2e840ee82044272ad781f60.png\"\/>  <\/p>\n<pre><code class=\"bash\">[-5 -4 -3 -2 -1  0  1  2  3  4] [0 0 0 0 0 0 1 2 3 4] ['eh' 'cl' 'ah' ..., 'ab' 'bm' 'ab'] ['ab' 'ac' 'ad' 'ae' 'af' 'ag' 'ah' 'ai' 'aj' 'ak' 'al' 'am' 'an' 'bc' 'bd'  'be' 'bf' 'bg' 'bh' 'bi' 'bj' 'bk' 'bl' 'bm' 'bn' 'cd' 'ce' 'cf' 'cg' 'ch'  'ci' 'cj' 'ck' 'cl' 'cm' 'cn' 'de' 'df' 'dg' 'dh' 'di' 'dj' 'dk' 'dl' 'dm'  'dn' 'ef' 'eg' 'eh' 'ei' 'ej' 'ek' 'el' 'em' 'en' 'fg' 'fh' 'fi' 'fj' 'fk'  'fl' 'fm' 'fn' 'gh' 'gi' 'gj' 'gk' 'gl' 'gm' 'gn' 'hi' 'hj' 'hk' 'hl' 'hm'  'hn' 'ij' 'ik' 'il' 'im' 'in' 'jk' 'jl' 'jm' 'jn' 'kl' 'km' 'kn' 'lm' 'ln'  'mn'] [48 33  6 ...,  0 23  0] ['eh' 'cl' 'ah' ..., 'ab' 'bm' 'ab'] ['eh' 'cl' 'ah' ..., 'ab' 'bm' 'ab'] ['bf' 'cl' 'dn' ..., 'dm' 'cn' 'dj'] ['bf' 'cl' 'dn' ..., 'dm' 'cn' 'dj']<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7bd\/d0a\/597\/7bdd0a597b304ac497cf5dd7da78311f.png\"\/><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/bbe\/46e\/832\/bbe46e832f72405d8ad11e49a8feee03.png\"\/>  <\/p>\n<pre><code class=\"bash\">[ 2.29711325  1.82679746  2.65173344 ...,  2.15286813  2.308737    2.15286813] 1000 loops, best of 3: 1.09 ms per loop The slowest run took 8.44 times longer than the fastest. This could mean that an intermediate result is being cached. 10000 loops, best of 3: 21.5 \u00b5s per loop<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/97c\/1b1\/631\/97c1b1631c6e4d5da33a152083e6df72.png\"\/>  <\/p>\n<pre><code class=\"bash\">0.416 0.416<\/code><\/pre>\n<p>  <\/p>\n<h2>%load<\/h2>\n<p>  \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u043a\u043e\u0434 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 \u044f\u0447\u0435\u0439\u043a\u0443. \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438\u043b\u0438 \u0438\u0437 \u0441\u0435\u0442\u0438.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0438\u0436\u0435, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<pre><code class=\"python\"># %load http:\/\/matplotlib.org\/mpl_examples\/pylab_examples\/contour_demo.py<\/code><\/pre>\n<p>  <\/p>\n<h2>%store \u2014 \u043b\u0435\u043d\u0438\u0432\u0430\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u0430\u043c\u0438<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\">data = 'this is the string I want to pass to different notebook' %store data del data # deleted variable<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">Stored 'data' (str)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># in second notebook I will use: %store -r data print data<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">this is the string I want to pass to different notebook<\/code><\/pre>\n<p>  <\/p>\n<h2>%who \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\"># pring names of string variables %who str<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\"> data <\/code><\/pre>\n<p>  <\/p>\n<h2>\u0422\u0430\u0439\u043c\u0438\u043d\u0433<\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043c\u0435\u0440\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438\u043b\u0438 \u043d\u0430\u0439\u0442\u0438 \u0443\u0437\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432 \u043a\u043e\u0434\u0435, \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0434\u0435\u0442 IPython.<\/p>\n<pre><code class=\"python\">%%time import time time.sleep(2) # sleep for two seconds<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">CPU times: user 1.23 ms, sys: 4.82 ms, total: 6.05 ms Wall time: 2 s<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># measure small code snippets with timeit ! import numpy %timeit numpy.random.normal(size=100)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">The slowest run took 13.85 times longer than the fastest. This could mean that an intermediate result is being cached. 100000 loops, best of 3: 6.35 \u00b5s per loop<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">%%writefile pythoncode.py  import numpy def append_if_not_exists(arr, x):     if x not in arr:         arr.append(x)          def some_useless_slow_function():     arr = list()     for i in range(10000):         x = numpy.random.randint(0, 10000)         append_if_not_exists(arr, x)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">Overwriting pythoncode.py<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># shows highlighted source of the newly-created file %pycat pythoncode.py<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">from pythoncode import some_useless_slow_function, append_if_not_exists<\/code><\/pre>\n<p>  <\/p>\n<h2>\u041f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435: %prun, %lprun, %mprun<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\"># shows how much time program spent in each function %prun some_useless_slow_function()<\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:<\/p>\n<pre><code class=\"bash\">26338 function calls in 0.713 seconds     Ordered by: internal time     ncalls  tottime  percall  cumtime  percall filename:lineno(function)     10000    0.684    0.000    0.685    0.000 pythoncode.py:3(append_if_not_exists)     10000    0.014    0.000    0.014    0.000 {method 'randint' of 'mtrand.RandomState' objects}         1    0.011    0.011    0.713    0.713 pythoncode.py:7(some_useless_slow_function)         1    0.003    0.003    0.003    0.003 {range}      6334    0.001    0.000    0.001    0.000 {method 'append' of 'list' objects}         1    0.000    0.000    0.713    0.713 &lt;string&gt;:1(&lt;module&gt;)         1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">%load_ext memory_profiler<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># tracking memory consumption (show in the pop-up) %mprun -f append_if_not_exists some_useless_slow_function()<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">('',)<\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:<\/p>\n<pre><code class=\"bash\">Line #    Mem usage    Increment   Line Contents ================================================      3     20.6 MiB      0.0 MiB   def append_if_not_exists(arr, x):      4     20.6 MiB      0.0 MiB       if x not in arr:      5     20.6 MiB      0.0 MiB           arr.append(x)<\/code><\/pre>\n<p>  <b>%lprun<\/b> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430, \u043d\u043e, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0440\u0435\u043b\u0438\u0437\u0435 Python \u043e\u043d \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043e\u0431\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u0431\u0435\u0437 \u043c\u0430\u0433\u0438\u0438:<\/p>\n<pre><code class=\"python\">import line_profiler lp = line_profiler.LineProfiler() lp.add_function(some_useless_slow_function) lp.runctx('some_useless_slow_function()', locals=locals(), globals=globals()) lp.print_stats()<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">Timer unit: 1e-06 s  Total time: 1.27826 s File: pythoncode.py Function: some_useless_slow_function at line 7  Line #      Hits         Time  Per Hit   % Time  Line Contents ==============================================================      7                                           def some_useless_slow_function():      8         1            5      5.0      0.0      arr = list()      9     10001        17838      1.8      1.4      for i in range(10000):     10     10000        38254      3.8      3.0          x = numpy.random.randint(0, 10000)     11     10000      1222162    122.2     95.6          append_if_not_exists(arr, x) <\/code><\/pre>\n<p>  <\/p>\n<h2>\u0414\u0435\u0431\u0430\u0433 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e %debug<\/h2>\n<p>  \u0423 Jupyter \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f <a href=\"https:\/\/docs.python.org\/2\/library\/pdb.html\">ipdb<\/a>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0439\u0442\u0438 \u0432\u043d\u0443\u0442\u0440\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u0432 \u043d\u0435\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p>  \u042d\u0442\u043e \u043d\u0435 PyCharm \u2014 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u0441\u0432\u043e\u0438\u0442\u044c, \u043d\u043e \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u0435\u0431\u0430\u0433\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c (\u043a\u0440\u043e\u043c\u0435 pdb \u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b).<\/p>\n<pre><code class=\"python\">#%%debug filename:line_number_for_breakpoint # Here some code that fails. This will activate interactive context for debugging<\/code><\/pre>\n<p>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u2014 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 %pdb, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0434\u0435\u0431\u0430\u0433\u0433\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"python\"># %pdb  # def pick_and_take(): #     picked = numpy.random.randint(0, 1000) #     raise NotImplementedError()      # pick_and_take()<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0417\u0430\u043f\u0438\u0441\u044c \u0444\u043e\u0440\u043c\u0443\u043b \u0432 LateX<\/h2>\n<p>  \u041c\u0430\u0440\u043a\u0434\u0430\u0443\u043d \u044f\u0447\u0435\u0439\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u044b LateX \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e MathJax.<\/p>\n<p><div style=\"text-align:center;\"><img decoding=\"async\"  src=\"https:\/\/tex.s2cms.ru\/svg\/P(A%7CB)%20%3D%20%7BP(B%7CA)P(A)%20%5Cover%20P(B)%7D\" alt=\"P(A|B) = {P(B|A)P(A) \\over P(B)}\"\/><\/div>\n<\/p>\n<p>  \u041c\u0430\u0440\u043a\u0434\u0430\u0443\u043d \u2014 \u0432\u0430\u0436\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u043e\u0432, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438!<\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u0430<\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0441\u043a\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043f\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u044f\u0437\u044b\u043a\u0430\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 Jupyter Notebook:<\/p>\n<ul>\n<li>%%python2<\/li>\n<li>%%python3<\/li>\n<li>%%ruby<\/li>\n<li>%%perl<\/li>\n<li>%%bash<\/li>\n<li>%%R,<\/li>\n<\/ul>\n<p>  \u043d\u043e, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0441\u0440\u0435\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<pre><code class=\"ruby\">%%ruby puts 'Hi, this is ruby.'<\/code><\/pre>\n<p>  <\/p>\n<pre><code>Hi, this is ruby.<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">%%bash echo 'Hi, this is bash.'<\/code><\/pre>\n<p>  <\/p>\n<pre><code>Hi, this is bash.<\/code><\/pre>\n<h2>\u0410\u043d\u0430\u043b\u0438\u0437 Big Data<\/h2>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c\/\u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043e\u0431\u044a\u0435\u043c\u044b \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/ipython\/ipyparallel\">ipyparallel (\u0431\u044b\u0432\u0448\u0438\u0439 ipython cluster)<\/a> \u2014 \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 map-reduce \u043d\u0430 Python. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0432 <a href=\"https:\/\/github.com\/yandex\/rep\">rep<\/a> \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e.<\/li>\n<li><a href=\"http:\/\/www.cloudera.com\/documentation\/enterprise\/5-5-x\/topics\/spark_ipython.html\">pyspark<\/a><\/li>\n<li>spark-sql magic <a href=\"https:\/\/github.com\/jupyter-incubator\/sparkmagic\">%%sql<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u0412\u0430\u0448\u0438 \u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u043c\u043e\u0433\u0443\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0432\u0430\u0448\u0438\u043c \u043a\u043e\u0434\u043e\u043c, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044f<\/h2>\n<p>  \u0422\u0430\u043a\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043a\u0430\u043a <a href=\"http:\/\/mybinder.org\/\">mybinder<\/a>, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a Jupiter Notebook \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0441 \u043f\u043e\u043b\u0447\u0430\u0441\u0430 \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u0448\u0438\u043c \u043a\u043e\u0434\u043e\u043c, \u0438\u043c\u0435\u044f \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440.<\/p>\n<p>  \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0430\u0448\u0443 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/github.com\/jupyterhub\/jupyterhub\">jupyterhub<\/a>, \u0447\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0435 \u043c\u0438\u043d\u0438-\u043a\u0443\u0440\u0441 \u0438\u043b\u0438 \u043c\u0430\u0441\u0442\u0435\u0440-\u043a\u043b\u0430\u0441\u0441 \u0438 \u0432\u0430\u043c \u043d\u0435\u043a\u043e\u0433\u0434\u0430 \u0434\u0443\u043c\u0430\u0442\u044c \u043e \u043c\u0430\u0448\u0438\u043d\u0430\u0445 \u0434\u043b\u044f \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432.<\/p>\n<h2>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445<\/h2>\n<p>  \u0418\u043d\u043e\u0433\u0434\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 NumPy \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0438 \u043c\u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u043d\u0430 Python\u2026<\/p>\n<p>  \u041d\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435, \u043a\u043e\u0433\u0434\u0430 \u0441\u043a\u0443\u0447\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u0437\u0430 \u043d\u0430\u0441, \u043f\u0440\u0430\u0432\u0434\u0430?<\/p>\n<p>  \u0412\u0435\u0434\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 Cython \u0438\u043b\u0438 Fortran \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 \u043a\u043e\u0434\u0430 \u043d\u0430 Python.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438<\/p>\n<pre><code class=\"python\">!pip install cython fortran-magic<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">%load_ext Cython<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"cpp\"> %%cython def myltiply_by_2(float x):     return 2.0 * x  <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"cpp\">myltiply_by_2(23.)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\"> 46.0 <\/code><\/pre>\n<p>  \u041b\u0438\u0447\u043d\u043e \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e Fortran, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c, \u044f \u0441\u0447\u0438\u0442\u0430\u044e, \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"http:\/\/arogozhnikov.github.io\/2015\/11\/29\/using-fortran-from-python.html\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<pre><code class=\"python\">%load_ext fortranmagic<\/code><\/pre>\n<p>  <\/p>\n<pre><code>\/Users\/axelr\/.venvs\/rep\/lib\/python2.7\/site-packages\/IPython\/utils\/path.py:265: UserWarning: get_ipython_cache_dir has moved to the IPython.paths module   warn(&quot;get_ipython_cache_dir has moved to the IPython.paths module&quot;)<\/code><\/pre>\n<p>  <\/p>\n<pre><code>%%fortran subroutine compute_fortran(x, y, z)     real, intent(in) :: x(:), y(:)     real, intent(out) :: z(size(x, 1))      z = sin(x + y)  end subroutine compute_fortran<\/code><\/pre>\n<p>  <\/p>\n<pre><code>compute_fortran([1, 2, 3], [4, 5, 6])<\/code><\/pre>\n<p>  <\/p>\n<pre><code>array([-0.95892429,  0.65698659,  0.41211849], dtype=float32)<\/code><\/pre>\n<p>  \u0414\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432\u0430\u0448 \u043a\u043e\u0434 \u043d\u0430 Python. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"http:\/\/arogozhnikov.github.io\/2015\/09\/08\/SpeedBenchmarks.html\">\u043c\u043e\u0435\u043c \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u0435<\/a>.<\/p>\n<h2>\u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u0443\u0440\u0441\u043e\u0440<\/h2>\n<p>   \u0421 \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 Jupyter \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u0443\u0440\u0441\u043e\u0440, \u0442\u0430\u043a\u043e\u0439, \u043a\u0430\u043a \u0432 Sublime \u0438\u043b\u0438 IntelliJ!<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/6d5\/8e3\/5f7\/6d58e35f74a64be1ab9000a3ef552f20.gif\"\/><br \/>  \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"http:\/\/swanintelligence.com\/multi-cursor-in-jupyter.html\">swanintelligence.com\/multi-cursor-in-jupyter.html<\/a><\/p>\n<h2><a href=\"https:\/\/github.com\/ipython-contrib\/jupyter_contrib_nbextensions\">\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f Jupyter-contrib<\/a><\/h2>\n<p>  \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<\/p>\n<pre><code class=\"python\">!pip install https:\/\/github.com\/ipython-contrib\/jupyter_contrib_nbextensions\/tarball\/master !pip install jupyter_nbextensions_configurator !jupyter contrib nbextension install --user !jupyter nbextensions_configurator enable --user<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/743\/c35\/9a7\/743c359a756c4216a7978f23b4c57557.png\"\/><\/p>\n<p>  \u042d\u0442\u043e \u0446\u0435\u043b\u043e\u0435 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439, \u0432\u043a\u043b\u044e\u0447\u0430\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, jupyter spell-checker \u0438 code-formatter, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 Jupyter \u043d\u0435\u0442.<\/p>\n<h2><a href=\"https:\/\/github.com\/damianavila\/RISE\">RISE<\/a>: \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432 Notebook<\/h2>\n<p>  \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 Damian Avila, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u044b \u043a\u0430\u043a \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438: <a href=\"http:\/\/bollwyvl.github.io\/live_reveal\/#\/7\">bollwyvl.github.io\/live_reveal\/#\/7<\/a><\/p>\n<p>  \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u0432\u044b \u043e\u0431\u0443\u0447\u0430\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<h2>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u044b\u0432\u043e\u0434\u0430 Jupyter<\/h2>\n<p>  \u0411\u043b\u043e\u043a\u043d\u043e\u0442\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0432 HTML, \u0438 \u0432\u044b\u0432\u043e\u0434 \u044f\u0447\u0435\u0439\u043a\u0438 \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 HTML, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0432\u0441\u0435, \u0447\u0442\u043e \u0434\u0443\u0448\u0435 \u0443\u0433\u043e\u0434\u043d\u043e: \u0432\u0438\u0434\u0435\u043e, \u0430\u0443\u0434\u0438\u043e, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u043c\u0438 \u0432 \u043c\u043e\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e \u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u044f\u0442\u044c \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<pre><code class=\"python\">import os from IPython.display import display, Image names = [f for f in os.listdir('..\/images\/ml_demonstrations\/') if f.endswith('.png')]<\/code><\/pre>\n<p>  <img decoding=\"async\" width=\"300\" src=\"https:\/\/habrastorage.org\/files\/920\/715\/c34\/920715c34f3844878a25985141087f2d.png\"\/><br \/>  <img decoding=\"async\" width=\"300\" src=\"https:\/\/habrastorage.org\/files\/12b\/102\/f7d\/12b102f7d36b4be9979cf759c17b4470.png\"\/><br \/>  <img decoding=\"async\" width=\"300\" src=\"https:\/\/habrastorage.org\/files\/5e6\/cfc\/be5\/5e6cfcbe59a8469194a10b640472cd1f.png\"\/><br \/>  <img decoding=\"async\" width=\"300\" src=\"https:\/\/habrastorage.org\/files\/ac7\/fee\/dd3\/ac7feedd3a2d4131a211a114feba4a50.png\"\/><br \/>  <img decoding=\"async\" width=\"300\" src=\"https:\/\/habrastorage.org\/files\/e69\/abb\/851\/e69abb85127245f18760439d22c31c72.png\"\/><\/p>\n<h2>\u042f \u043c\u043e\u0433 \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u0441\u043f\u0438\u0441\u043e\u043a bash-\u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439,<\/h2>\n<p>  \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e magic-\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 bash-\u0432\u044b\u0437\u043e\u0432\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 Python:<\/p>\n<pre><code class=\"bash\">names = !ls ..\/images\/ml_demonstrations\/*.png names[:5]<\/code><\/pre>\n<p>  <\/p>\n<pre><code>['..\/images\/ml_demonstrations\/colah_embeddings.png',  '..\/images\/ml_demonstrations\/convnetjs.png',  '..\/images\/ml_demonstrations\/decision_tree.png',  '..\/images\/ml_demonstrations\/decision_tree_in_course.png',  '..\/images\/ml_demonstrations\/dream_mnist.png']<\/code><\/pre>\n<h2>\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u044f\u0434\u0440\u0443<\/h2>\n<p>  \u0414\u0430\u0432\u043d\u044b\u043c \u0434\u0430\u0432\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u043e\u043b\u0433\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 IPython \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043b\u043e\u0441\u044c, \u0432\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0442\u0435\u0440\u044f\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 (\u0435\u0441\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b \u043d\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u0430\u0439\u043b). \u041f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0438\u043b\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u044f\u0434\u0440\u0430 \u0441 \u0440\u0438\u0441\u043a\u043e\u043c \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u0438\u043b\u0438 \u0436\u0434\u0430\u0442\u044c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043d\u0435 \u0438\u043c\u0435\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043f\u0446\u0438\u044f <code>Reconnect to kernel<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043d\u043e\u0432\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u043c\u0443 \u044f\u0434\u0440\u0443, \u043d\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 (\u0445\u043e\u0442\u044f \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u0432\u044b\u0432\u043e\u0434\u0430 \u0432\u0441\u0435 \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u0430).<\/p>\n<h2>\u041f\u0438\u0448\u0438\u0442\u0435 \u0432\u0430\u0448\u0438 \u043f\u043e\u0441\u0442\u044b \u0432 Notebook<\/h2>\n<p>  \u0442\u0430\u043a\u0438\u0435, \u043a\u0430\u043a <a href=\"http:\/\/arogozhnikov.github.io\/2016\/09\/10\/jupyter-features.html\">\u044d\u0442\u043e\u0442<\/a>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 nbconvert, \u0447\u0442\u043e\u0431\u044b \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 HTML.<\/p>\n<h2>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/ipython.org\/ipython-doc\/3\/interactive\/magics.html\">\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 magic-\u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/a> IPython<\/li>\n<li>\u0425\u043e\u0440\u043e\u0448\u0430\u044f <a href=\"http:\/\/quasiben.github.io\/dfwmeetup_2014\/#\/\">\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043e Jupyter<\/a> \u043e\u0442 Ben Zaitlen<\/li>\n<li>\u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u044b <a href=\"https:\/\/blog.dominodatalab.com\/lesser-known-ways-of-using-notebooks\/\">part 1: magics<\/a> and <a href=\"https:\/\/blog.dominodatalab.com\/interactive-dashboards-in-jupyter\/\">part 2: widgets<\/a><\/li>\n<li><a href=\"http:\/\/pynash.org\/2013\/03\/06\/timing-and-profiling\/\">\u041f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 Python-\u043a\u043e\u0434\u0430 \u0432 Jupyter<\/a><\/li>\n<li><a href=\"http:\/\/mindtrove.info\/4-ways-to-extend-jupyter-notebook\/\">Four Ways to Extend Jupyter Notebook<\/a><\/li>\n<li><a href=\"https:\/\/www.quora.com\/What-are-your-favorite-tricks-for-IPython-Notebook\">IPython notebook tricks<\/a><\/li>\n<li><a href=\"https:\/\/www.linkedin.com\/pulse\/comprehensive-comparison-jupyter-vs-zeppelin-hoc-q-phan-mba-\">Jupyter vs Zeppelin for big data<\/a><\/li>\n<\/ul>\n<p>  Notebook \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438\u0437 <a href=\"https:\/\/github.com\/arogozhnikov\/arogozhnikov.github.io\/tree\/master\/notebooks\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a>.<br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/316826\/\"> https:\/\/habrahabr.ru\/post\/316826\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jupyter Notebook \u2013 \u044d\u0442\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0445 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0442\u0447\u0435\u0442\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u043a\u043e\u0434, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0438:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/15f\/720\/7f7\/15f7207f72e64f4192320b0bb2544664.png\"\/><\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u0438\u0448\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 Jupyter \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0443\u0442\u044b\u043c. \u041e \u043d\u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445, \u043d\u043e \u0435\u0441\u043b\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u0442\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0438 \u043d\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0448\u044c.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-282069","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=282069"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282069\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=282069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=282069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}