<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gautam Borgohain on Medium]]></title>
        <description><![CDATA[Stories by Gautam Borgohain on Medium]]></description>
        <link>https://medium.com/@gautamborgohain?source=rss-4f967b67dc41------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4ODSQH952Q6PdjyrJKcE4w.jpeg</url>
            <title>Stories by Gautam Borgohain on Medium</title>
            <link>https://medium.com/@gautamborgohain?source=rss-4f967b67dc41------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 17:32:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gautamborgohain/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Step by Step Guide to deploying ML Models to AWS Lambda using Zappa]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@gautamborgohain/step-by-step-guide-to-deploying-ml-models-to-aws-lambda-using-zappa-41561e9d04b4?source=rss-4f967b67dc41------2"><img src="https://cdn-images-1.medium.com/max/2600/1*DOLcHOdOwn9-uLKEi140uw.jpeg" width="4032"></a></p><p class="medium-feed-snippet">Deploy your ML models into production as Serverless apps!</p><p class="medium-feed-link"><a href="https://medium.com/@gautamborgohain/step-by-step-guide-to-deploying-ml-models-to-aws-lambda-using-zappa-41561e9d04b4?source=rss-4f967b67dc41------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@gautamborgohain/step-by-step-guide-to-deploying-ml-models-to-aws-lambda-using-zappa-41561e9d04b4?source=rss-4f967b67dc41------2</link>
            <guid isPermaLink="false">https://medium.com/p/41561e9d04b4</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[zappa]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Gautam Borgohain]]></dc:creator>
            <pubDate>Mon, 22 Jun 2020 03:52:45 GMT</pubDate>
            <atom:updated>2020-06-22T03:52:45.130Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Setting up AWS roles and policies for Lambda apps using Zappa]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@gautamborgohain/setting-up-aws-roles-and-policies-for-lambda-apps-using-zappa-f943b2d627ae?source=rss-4f967b67dc41------2"><img src="https://cdn-images-1.medium.com/max/2600/1*dmfa1cDvLsUEVRRPmY6nDw.jpeg" width="4032"></a></p><p class="medium-feed-snippet">This post lists the steps to create the policies and roles required for managing AWS Lambda deployments using Zappa.</p><p class="medium-feed-link"><a href="https://medium.com/@gautamborgohain/setting-up-aws-roles-and-policies-for-lambda-apps-using-zappa-f943b2d627ae?source=rss-4f967b67dc41------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@gautamborgohain/setting-up-aws-roles-and-policies-for-lambda-apps-using-zappa-f943b2d627ae?source=rss-4f967b67dc41------2</link>
            <guid isPermaLink="false">https://medium.com/p/f943b2d627ae</guid>
            <category><![CDATA[zappa]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <dc:creator><![CDATA[Gautam Borgohain]]></dc:creator>
            <pubDate>Mon, 22 Jun 2020 03:46:41 GMT</pubDate>
            <atom:updated>2020-06-22T03:46:41.283Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Jupyter tools to increase productivity]]></title>
            <link>https://medium.com/data-science/jupyter-tools-to-increase-productivity-7b3c6b90be09?source=rss-4f967b67dc41------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b3c6b90be09</guid>
            <category><![CDATA[ipython]]></category>
            <category><![CDATA[jupyter]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <dc:creator><![CDATA[Gautam Borgohain]]></dc:creator>
            <pubDate>Mon, 18 Jun 2018 14:39:32 GMT</pubDate>
            <atom:updated>2018-06-18T14:39:45.976Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g3L9F6AO-jUW-QuQRFI3JA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/vS7LVkPyXJU?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Philip Swinburn</a> on <a href="https://unsplash.com/search/photos/tools?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><blockquote><em>“If the only tool you have is a hammer, you tend to see every problem as a nail.”</em></blockquote><blockquote><em>Abraham Maslow</em></blockquote><p>Like for so many other data scientists, Jupyter notebook is an indispensable part of my data science toolkit. It is easy to use and incredibly powerful. In this post I will document some of the extensions and features available that I think everybody using Jupyter should familiarise themselves with.</p><p><em>But wait, isn’t this old stuff now, should we be getting comfortable with JupyterLab now since it is just on the horizon?</em></p><p><a href="https://github.com/jupyterlab/jupyterlab">JupyterLab</a> is the evolution on Jupyter notebooks and introduces some much awaited features, however its currently in beta and when I tried it out and found that a lot of the cool extensions that have been built for JupyterLab don’t work well cause of version compatibility issues. So I think, even though JupyterLab is the future, for at-least the near future, I am just gonna stick with classic notebooks for a couple more months.</p><h3>Jupyter contrib nbextensions</h3><p>Did you know there are extensions for Jupyter notebook! Well there are, and they are very useful!</p><p><em>Installation</em></p><p>The <a href="https://github.com/ipython-contrib/jupyter_contrib_nbextensions">official github repo</a> has all the detail for installation so I will not repeat those. But if you are lazy to go over that , here is the TLDR version with the basic steps:</p><pre>pip install jupyter_contrib_nbextensions</pre><pre>pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master</pre><pre>jupyter contrib nbextension install --user</pre><p>Also install the extensions configurator for easy toggling of extensions:</p><pre>pip install jupyter_nbextensions_configurator</pre><pre>jupyter nbextensions_configurator enable --user</pre><p>You are done!</p><p>Refresh Jupyter home page and you should be able to see something like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*0yy5_nplpfMXuqexaL6Slw.png" /><figcaption>nbextensions tab</figcaption></figure><p>Here are some nbextensions that I find useful and short description on what they do :</p><ol><li><em>Table of Contents (2) </em>: This creates a TOC automatically based on the header cells in the notebook. The Display Table of Contents as a sidebar option creates a TOC as a sidebar which helps keeping context and also navigating across the notebook.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ijytWCYz2jhUsZlmFLNEfA.png" /><figcaption>Table of contents</figcaption></figure><p><em>2. Collapsible Headings</em>: This along with toc2 is great to roll up sections of the notebook that you don’t want to focus on at a particular time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJSgnV-R4sloJAYY5LN7-g.gif" /><figcaption>Collapsible heading</figcaption></figure><p><em>3. Codefolding</em> : You can reduce the size of the cells by collapsing function definitions and long code blocks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*Ui23HiD2D1TdmYtVPA_3lw.gif" /><figcaption>codefolding</figcaption></figure><p><em>4. ExecuteTime</em> : The %%time cell magic function is great for checking runtime. But with ExecuteTime, the runtime of all the code cells are displayed on the bottom left, so you don’t need remember to use the cell magic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*ol-ZB7CXzuai4TfwQkW-cA.png" /><figcaption>execute time</figcaption></figure><p><em>5. Gist-it</em> : Great for creating gists on Github. Why gist? You can save different versions of the same notebook at different states during experiments. Also, gists are easier to share and refer back.</p><p><em>6. Hide all Input</em> : For times when you need to code to generate and output, but don’t need to show the code (for brevity) , this is great to clean up a notebook for presentation.</p><h3>Jupyter Magics functions</h3><p>There are a lot of magic functions in Jupyter. For the Ipython kernel, here is the <a href="http://ipython.readthedocs.io/en/stable/interactive/magics.html">link to the docs</a>.</p><p>Here are some line magics functions that I have found to be particularly useful :</p><ol><li>%cd &lt;path&gt; : Quick way to switch working dir while in notebook.</li><li>%autoreload : Use this at every notebook where you use scripts/ projects . The changes you do to them will be auto re-loaded into jupyter context.</li></ol><pre>%reload_ext autoreload<br>%autoreload 2</pre><ol><li>%timeit : Runs the code line multiple times and prints the metrics of code runtime.</li><li>%lprun and %mprun : Line profiler and memory profiler for python. Great for optimising code:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*UvtoHHO9vO3jMzUMN1I73w.png" /><figcaption>line profiler in action</figcaption></figure><p>To use line_profiler, install it using pip :</p><pre>pip install line-profiler<br>pip install memory_profiler</pre><p>Then load the extension :</p><pre>%load_ext line_profiler<br>%load_ext memory_profiler</pre><ol><li>! or %%bash : Bash commands are easy to use on terminal but if you have a sequence of commands that you repeatedly need to run, its so much better to have them in a notebook! The ! before a line will execute the line in bash. e.g. :</li></ol><pre>!ls -lht</pre><p>If you use cloud services like AWS, and you have multiple cli commands, putting them in a notebook makes life much easier since you have searchable history of command and the result.</p><p>Note: For some reason I have found that using the cell magics %%bashprints the output <em>after</em> the execution is complete. Which is fine for most use cases, but say you are checking docker logs, you might be itchy to check the progress.</p><h3>Extras</h3><p>There are a ton of other cool things Jupyter can do, but I can’t go over them all but just a short list:</p><ol><li><em>Jupyter widgets :</em> Jupyter supports widgets as well to support useful <a href="https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20List.html">interactions</a> and even cool <a href="http://jupyter.org/widgets">visualisations</a>. The interaction widgets are great for creating interactive notebooks and I suppose they would be greater if you have JupyterHub setup so you can collaborate on notebooks.</li><li><em>Cross language support :</em> It turns out Jupyter is actually an acronym — Julia Python R and there are a ton of <a href="https://github.com/jupyter/jupyter/wiki/Jupyter-kernels">kernels for different languages.</a> .</li><li><em>Debugging :</em> There are a lot of debugging options available for Jupyter notebooks and which one is the most productive largely depends on how you write your code . For me, since I put most of the code in .py files, I debug code using the ipython debugger :</li></ol><pre>from IPython.core.debugger import set_trace</pre><pre>def func(x):<br>	x = x+2<br>	set_trace()<br>	x = x-2<br>	return x</pre><pre>func(2)</pre><p>This will pop an interactive box to inspect variables in the notebook.</p><p>There are easier to use options available too:</p><p>The %%pdb cell magic which opens the debugger interface when there is an exception.</p><p>Or you can run the %debug line magic immediately after an exception to inspect the stack.</p><p>4. Jupyter notebook preview with Vistual Studio Code</p><p>So notebooks are great and you can do much more with them when you are more organised. However, versioning of notebooks is still a problem. Meaning you can end up making tens of notebooks for a project and if you want to hunt down some code you had written early on in your project, you will have to open them up one by one or try to remember relevant keywords to grep . Well, I don’t not have a clean solution for the versioning problem other than using naming conventions and taking advantage of folder structures, but, for me it helps if I can preview a notebook without having to start a kernel and wait for it to load (specially if the notebook is large). Visual Studio Code to rescue! This handy text editor is very similar to Sublime Text and has a handy plugin vscode-nbpreviewer which allows you to open notebooks without starting a kernel, which is super fast to load.</p><p>Another perk of using Visual Studio Code: spyder like code cells in script , so you can send code from script to editor</p><p>Also, it comes as an optional install with Anaconda!</p><p>Thats all I have for now. As I come across more things i fin useful, I will keep updating this. Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b3c6b90be09" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/jupyter-tools-to-increase-productivity-7b3c6b90be09">Jupyter tools to increase productivity</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>