<?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 Michał Krassowski on Medium]]></title>
        <description><![CDATA[Stories by Michał Krassowski on Medium]]></description>
        <link>https://medium.com/@krassowski.michal?source=rss-c65fcb2b99f2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*alZlDQFcXfm66lcRiGvqGQ.jpeg</url>
            <title>Stories by Michał Krassowski on Medium</title>
            <link>https://medium.com/@krassowski.michal?source=rss-c65fcb2b99f2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 01:30:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@krassowski.michal/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[JupyterLab 4.6 and Notebook 7.6 are out!]]></title>
            <link>https://medium.com/jupyter-blog/jupyterlab-4-6-and-notebook-7-6-are-out-dd84e1e919f2?source=rss-c65fcb2b99f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd84e1e919f2</guid>
            <category><![CDATA[jupyterlab]]></category>
            <category><![CDATA[scientific-computing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Michał Krassowski]]></dc:creator>
            <pubDate>Thu, 02 Jul 2026 16:13:50 GMT</pubDate>
            <atom:updated>2026-07-02T16:15:16.057Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://jupyterlab.readthedocs.io/en/latest/getting_started/changelog.html#v4-6">JupyterLab 4.6</a> features new interface customization options, improved file browser and debugger, an easy way to jump between recently edited cells, and numerous other notebook experience improvements. Keyboard shortcuts, navigation and accessibility is another focus area in this release. <a href="https://jupyter-notebook.readthedocs.io/en/stable/changelog.html#id1">Jupyter Notebook 7.6</a> has also been released, including the fixes and enhancements of JupyterLab along with a new Scratchpad console and other Notebook-specific improvements. This article highlights notable changes in both applications.</p><blockquote>You can try out the changes in your browser: <a href="https://jupyter.org/try-jupyter/lab/index.html">JupyterLab 4.6</a>, <a href="https://jupyter.org/try-jupyter/notebooks/?path=notebooks/Intro.ipynb">Notebook 7.6</a><br>At the time of publication, the preview runs on <a href="https://github.com/jupyterlite/jupyterlite">JupyterLite</a> 0.8.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zni6m_lgsXqu-zsGH77zBw.png" /><figcaption>Overview of some user interface enhancements visible in JupyterLab UI</figcaption></figure><h3>Enhancements shared by JupyterLab and Notebook</h3><h4>Notebook improvements</h4><p>Two new navigation commands, “Select previous last modified cell” and “Select next last modified cell”, allow jumping back and forward through recently edited cells. The commands are accessible from the Command Palette and as buttons in the <a href="https://jupyterlab.readthedocs.io/en/latest/user/toc.html">Table Of Contents</a> toolbar when a notebook is active.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/285/0*3gi9bAn6k4-yH8MP.png" /><figcaption>Clicking the highlighted button will jump to a previously edited cell</figcaption></figure><p>Copy, cut, and paste text commands have been added to the notebook context menu. This feature requires permission to access clipboard to work reliably and may not work in Firefox depending on version and additional restrictions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/0*fuYCAQUXQwuqp6cG.png" /><figcaption>Copy/Cut/Paste Selected cells expose clipboard actions on cell source</figcaption></figure><p>The cell toolbar delete button now shows a confirmation dialog to prevent accidental deletion. The “Do not ask me again” checkbox is available and the preference is persisted in <a href="https://jupyterlab.readthedocs.io/en/latest/user/notebook.html#cell-toolbar">Cell Toolbar</a> settings. The standard keyboard shortcut (D, D) is unaffected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/0*vITL_K8lFE_UIsHj.png" /><figcaption>Dialog shown when deleting a cell from cell tollbar</figcaption></figure><p>Pressing Ctrl + B (Cmd + B on macOS) in a markdown cell wraps the selected text in bold formatting.</p><p>When exporting a notebook as HTML via <a href="https://jupyterlab.readthedocs.io/en/latest/user/export.html">File → Save and Export Notebook As → HTML</a>, a dialog now asks whether to sanitize the HTML output before download.</p><h4>File browser: new column, editable breadcrumbs, open in terminal</h4><p>A new “Date Created” column has been added to the file browser, showing when files were created. The column can be toggled via Settings → File Browser → “Show date created column” or by right-clicking the column header. The latest jupyter-server (v2.18+) is required for accurate values across operating systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/0*epZrkZYQDIzropSt.png" /><figcaption>New date created column in file browser</figcaption></figure><p>The breadcrumb bar now supports <a href="https://jupyterlab.readthedocs.io/en/latest/user/files.html#editable-breadcrumbs">direct path editing</a> with tab-completion. Clicking the area behind breadcrumbs (highlighted on hover), or using the Command Palette, opens an editable text field where pressing Tab completes the longest common prefix of matching subdirectories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*grxuAxyEQqLFVn6d.png" /><figcaption>Editable breadcrumbs</figcaption></figure><p>A new “Open in Terminal” option in the file browser context menu opens a terminal navigated to the selected directory. When multiple directories are selected, one terminal is opened per directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/0*aespdpw35miy6vmr.png" /><figcaption>Opening terminal for a specific directory is now easier.</figcaption></figure><p>Additional file browser improvements include: a configurable <a href="https://jupyterlab.readthedocs.io/en/latest/user/files.html#file-name-sort-order">file name sort order</a>, persistence of the sort state across sessions, automatic clearing of the file filter when changing directories, and a loading animation during file browser refresh.</p><h4>Debugger: kernel sources filter, floating overlay</h4><p>The debugger Sources panel has been moved out of the debugger sidebar; the Sources now open as read-only editors in the main area, keeping the sidebar uncluttered while you <a href="https://jupyterlab.readthedocs.io/en/latest/user/debugger.html#explore-the-code-state">explore the code state</a>. The previous behavior can be restored by disabling the “Show Sources in Main Area” setting in the Debugger settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*l0V_AJYDsYfEOA54.png" /></figure><p>An overlay with continue/step in/stop buttons has been added easing the control of the debugger steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/0*-kwAopUu6uow4ERY.png" /></figure><p>The Kernel Sources filter bar has been moved to the toolbar and now supports live filtering, making it easier to search through kernel source files while debugging.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/0*lXUep59E1svw80P6.png" /></figure><p>The refresh button for sources list was removed — the sources will now update automatically after each code execution.</p><h4>Keyboard navigation and accessibility</h4><p>Keyboard navigation has been improved across several components:</p><ul><li>The terminal no longer traps keyboard focus, allowing users to move focus away with the keyboard.</li><li>The console and file browser breadcrumbs both received keyboard navigation fixes.</li><li>Focus is now correctly restored after closing the command palette, and input elements in dialogs opened from the command palette receive focus immediately.</li><li>The find-and-replace button focus in the document search box has been corrected.</li></ul><p>Screen reader behavior has been improved in the launcher and notebook. Toolbar buttons now correctly reflect their pressed state via the aria-pressed attribute.</p><p>The Keyboard Shortcuts settings panel has been updated to improve accessibility, including better keyboard interaction and screen reader announcements within the shortcuts editor dialog.</p><p>Focus indicators have been improved across the interface, including the status bar and other interactive components.</p><h4>Keyboard shortcuts</h4><p>Shortcuts can now be added from the UI shortcut editor for any command (previously this required writing JSON in Advanced Settings Editor).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JYHGSldDZ4bsNCVk.png" /></figure><p>“Find and Replace” has been added to the Edit menu with the keyboard shortcut Ctrl + H (Cmd + H on macOS).</p><p>Ctrl + Y has been added as a redo shortcut on Windows and Linux.</p><p>Pressing 1, 2, 3, 4, 5 and 6 will no longer convert a focused code or raw cell to Markdown to avoid accidental conversions. These shortcuts continue working on markdown cells, switching the heading level, as they did before.</p><h4>Internationalization</h4><p>Language packs can now be installed directly from within JupyterLab by selecting “Install more languages…” at the bottom of the Settings → Language menu. This opens the Extension Manager pre-filled with a search for available language pack extensions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/0*IAY1NHv2eUZlhsoQ.png" /></figure><h4>Terminal enhancements</h4><p>Pressing Shift+Enter in the terminal now inserts a newline without executing the current line. This matches the behavior expected by certain terminal applications.</p><h4>Inline completion enhancements</h4><p><a href="https://jupyterlab.readthedocs.io/en/latest/user/completer.html#inline-completer">Inline completion suggestions</a> can now be rendered with syntax highlighting that matches the active editor language. This can be enabled in Settings → Inline Completer → “Ghost text syntax highlighting”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/0*eUvIfOASnsZ0RTSH.png" /></figure><p>Ghost text is now also shown for all active cursors in a multi-cursor editing session.</p><h3>JupyterLab-specific enhancements</h3><h4>Layout and interface customization</h4><p>The activity bar can now be positioned at the top or bottom of the interface, in addition to the default left and right placement. The setting is available under Settings → Interface → <a href="https://jupyterlab.readthedocs.io/en/latest/user/interface_customization.html#activity-bar-position">Activity Bar Position</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FZnWSzWq9TsSfnYH.png" /></figure><p>Sections of accordion sidebars can now be <a href="https://jupyterlab.readthedocs.io/en/latest/user/interface_customization.html#move-accordion-sections-between-panels">moved between panels</a> via a context menu. Right-clicking a section header shows a “Move To” menu. The placement and collapsed state of moved sections are persisted across sessions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/0*EaVBoUQh5fMYTOCs.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/0*cGeR3SdD_1GL4pcS.png" /></figure><p>The sidebar panels themselves can be <a href="https://jupyterlab.readthedocs.io/en/latest/user/interface_customization.html#move-open-widgets">moved between areas</a>. Right-clicking a sidebar shows submenu with options to move it to the main area, a different sidebar, or the down area.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/0*vZPh7LgFw5VKY96R.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tqASYUG9UE6LoV2y.png" /></figure><p>Tabs can now be split in four directions using the “Split Tab” context menu item (or the command palette), which adds split left, right, up, and down options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/0*7qxAk2wzTtYyiR7c.png" /></figure><p>Individual panels can be zoomed in or out using Ctrl + mouse wheel (when “Enable Ctrl+ Scroll Zoom” is turned on in Settings → Interface) or via the command palette, without affecting other panels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/0*COyiDcTCqgm8mJcD.png" /></figure><h4>Performance</h4><p>Panel resizing is now more responsive; the width of individual widgets inside resized panels is frozen during the drag. This behaviour can be disabled by toggling “Optimize panel resize” in Settings → Application Shell.</p><h3>Notebook-specific enhancements</h3><h4>Scratchpad console</h4><p>A scratchpad console can now be opened next to a notebook, sharing the same kernel. This makes it easy to run quick experiments or inspect variables without modifying the notebook itself.</p><p>The scratchpad console can be opened from the File -&gt; New -&gt; Scratchpad console menu, from the command palette, or with the Ctrl + B (or Cmd + B on macOS) keyboard shortcut, which toggles the console panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cxBr835uxAtjpO9Tlqg7bw.png" /></figure><h4>Confirmation dialog when closing and shutting down a notebook</h4><p>The “Close and Shut Down Notebook” command now asks for confirmation before closing the browser tab and shutting down the kernel. The confirmation prompt can be disabled in the Settings Editor with the “Prompt for confirmation before closing and shutting down” setting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hWEaY7HfHBjzbajj9OIKtQ.png" /></figure><h3>Miscellaneous</h3><ul><li>Tab widths in JupyterLab are kept frozen while the mouse pointer hovers over them, making it easier to close multiple tabs with the mouse</li><li>Autocompletion heuristics were improved; the autocompletion (which remains opt-in) should no longer trigger in unexpected scenarios</li><li>The output scroll overlay collapse icon is now visible regardless of the output size and scroll state</li><li>The fonts used across components were standardized and fonts specified by themes or overrides are respected in every component of the application</li></ul><h3><strong>For extension authors</strong></h3><p>Building extensions (and JupyterLab/Notebook themselves) is now ~5 times faster thanks to migration from webpack to Rspack. Building extensions no longer requires a full JupyterLab installation as the relevant machinery was extracted to <a href="https://github.com/jupyterlab/jupyter-builder">jupyter-builder</a> (see this <a href="https://blog.jupyter.org/announcing-jupyter-builder-a-standalone-build-system-for-jupyterlab-extensions-c3d4cc06fa95?source=collection_home_page----95916e268740-----1-----------------------------------">blog post</a> for more details). This (among others) enables faster build environment setup on CI. Future improvements to the build system can now be released independently of the JupyterLab release cadence.</p><p>Please refer to the <a href="https://jupyterlab.readthedocs.io/en/latest/extension/extension_migration.html#jupyterlab-4-5-to-4-6">Extension Migration Guide</a> for more details on API changes and up-to-date advice.</p><h3>As large as minor releases go</h3><p>This JupyterLab release includes 68 new features and enhancements, 97 bug fixes, and 38 documentation improvements. 95 people contributed to this release. Across record-breaking 171 maintenance tasks we kept the dependencies up-to-date, improved quality of code and reduced the time to PRs getting merged by improving the CI performance and robustness. These efforts were in part funded by <a href="https://jupyterfoundation.org/">Jupyter Foundation</a> <a href="https://jupyterfoundation.org/community-funding-proposals/">Community Proposals</a>.</p><p>While the size of minor releases fluctuated across years, this one is on the higher side, with only v3.1 featuring slightly more merged PRs. The reviewers worked hard to ensure no regressions are introduced, but if any slipped through, please open an issue in respective repository (<a href="https://github.com/jupyterlab/jupyterlab/issues/new/choose">JupyterLab</a> or <a href="https://github.com/jupyter/notebook/issues/new/choose">Notebook</a>).</p><h3>Acknowledgements</h3><p>Thank you to all the new contributors, we hope to see you back!</p><ul><li>JupyterLab (39): @aarondr77, @Akshitguptaa, @altis0725, @amanparganiha, @anafontan, @autodots-AHassan, @aviu16, @bittoby, @boskodev790, @chenjiahan, @cursoragent, @dhgoal, @DTiming24, @github29tani, @GlassOfWhiskey, @harshaagrawal20, @hroncok, @jayaprajapatii, @JaYRaNa213, @jianyexi, @ktaletsk, @lin9long, @mfisher87, @MMesch, @moktamd, @nightcityblade, @nthiery, @raffaelemancuso, @RamiNoodle733, @reteps, @rodrigosf672, @Siddhazntx, @statxc, @TheChyeahhh, @tsharma-dev, @tubaman, @u-wlkjyy, @Yahiewi, @ZhYGuoL</li><li>Notebook (9): @bodhisilberling, @Darshan808, @goelakash, @joaovml, @KH-Coder865, @Mirochill, @xlumzee, @yangsong97, @Yann-P</li></ul><p>And thank you to returning contributors for their continued work!</p><ul><li>JupyterLab (56): @aaron-seq, @afshin, @agriyakhetarpal, @AliMahmoudDev, @andrii-i, @apoorvdarshan, @arjxn-py, @arun-357, @bollwyvl, @brichet, @Carreau, @ceasermikes002, @cmarmo, @CrafterKolyan, @Darshan808, @davidbrochart, @DeborahOlaboye, @doshi-kevin, @erkin98, @fcollonval, @filipeoliveira05, @flaviomartins, @fleming79, @FoSuCloud, @frenzymadness, @HaudinFlorence, @i-aki-y, @ianhi, @ianthomas23, @IsabelParedes, @itsmejay80, @itsmevichu, @JamesWrigley, @jasongrout, @JasonWeill, @jimangel, @jtpio, @krassowski, @Krish-876, @linlol, @martinRenou, @Meriem-BenIsmail, @MUFFANUJ, @peytondmurray, @prajyot-porje, @pranshugupta01, @RRosio, @schmidi314, @soniya-malviy, @superlevure, @SylvainCorlay, @tmetzl, @utsav-develops, @xc2, @Yann-P, @Zsailer</li><li>Notebook (9): @andrii-i, @brichet, @Carreau, @jtpio, @krassowski, @martinRenou, @minrk, @RamiNoodle733, @takluyver</li></ul><p>Thank you to all the people who tested and provided feedback for the pre-releases! Lastly, thank you to the weekly triage group for triaging JupyterLab and Notebook issues: @RRosio, @krassowski, @andrii-i, @rodrigosf672, @ktaletsk among others who attend.</p><h3>Further reading</h3><p>For more details, see:</p><ul><li>Full Release Notes for <a href="https://jupyterlab.readthedocs.io/en/latest/getting_started/changelog.html#v4-6">JupyterLab 4.6</a> and <a href="https://jupyter-notebook.readthedocs.io/en/stable/changelog.html#id1">Notebook 7.6</a></li><li>Full changelog on GitHub: <a href="https://github.com/jupyterlab/jupyterlab/releases/tag/v4.6.0">JupyterLab</a> and <a href="https://github.com/jupyter/notebook/releases/tag/v7.6.0">Notebook</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd84e1e919f2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jupyter-blog/jupyterlab-4-6-and-notebook-7-6-are-out-dd84e1e919f2">JupyterLab 4.6 and Notebook 7.6 are out!</a> was originally published in <a href="https://medium.com/jupyter-blog">Jupyter Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Productivity tips for Jupyter (Python)]]></title>
            <link>https://medium.com/data-science/productivity-tips-for-jupyter-python-a3614d70c770?source=rss-c65fcb2b99f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3614d70c770</guid>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[jupyter]]></category>
            <category><![CDATA[jupyterlab]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Michał Krassowski]]></dc:creator>
            <pubDate>Mon, 18 Mar 2019 00:18:09 GMT</pubDate>
            <atom:updated>2020-01-14T20:08:48.540Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve been very busy working on my MRes project in recent weeks, having very little sleep. This made me seek ways to improve my workflow in the most important tool of my work: Jupyter Notebook/Jupyter Lab. I collected all the hacks &amp; tips in this piece, hoping that other researchers may find those useful:</p><ol><li><a href="#3b5a">Play a sound once the computations have finished (or failed)</a></li><li><a href="#ad45">Integrate the notifications with your OS (ready for GNOME shell)</a></li><li><a href="#3424">Jump to definition of a variable, function or class</a></li><li><a href="#7a8a">Enable auto-completion for rpy2 (great for ggplot2)</a></li><li><a href="#2c78">Summarize dictionaries and other structures in a nice table</a></li><li><a href="#8dd4">Selectively import from other notebooks</a></li><li><a href="#68cb">Scroll to the recently executed cell on error or when opening the notebook</a></li><li><a href="#8313">Interactive (following) tail for long outputs</a></li></ol><p>Note: To make it easy-to-use, I collected the snippets presented below into a Python3 package (<a href="https://github.com/krassowski/jupyter-helpers">jupyter-helpers</a>). You can get it with:</p><p>pip3 install jupyter_helpers</p><p>It will work out of the box, but if you wish the best experience, these dependencies are highly recommended:</p><pre>pip3 install ipywidgets<br>jupyter labextension install @jupyter-widgets/jupyterlab-manager</pre><h3>1. Play a sound once the computations have finished</h3><p>You can configure your Jupyter to play a sound if the execution of the cell (or strand of cells) took more than a few seconds. I have previously described two methods for that, <a href="https://stackoverflow.com/a/50648266/6646912">a Python-based one</a>, and <a href="https://stackoverflow.com/a/50569680/6646912">a JavaScript one</a>. The code for the python one roughly goes like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e7defa5a7edc8e8f83cd70647277cca3/href">https://medium.com/media/e7defa5a7edc8e8f83cd70647277cca3/href</a></iframe><p>However, the helpers package got an upgraded version which takes care of hiding the Audio player and many other things. Use it like this:</p><pre>from jupyter_helpers.notifications import Notifications</pre><pre>Notifications(<br>     success_audio=&#39;path/to/beep-07.wav&#39;, time_threshold=2<br>)</pre><p>In the example above, I use beep-07.wav from <a href="https://www.soundjay.com/beep-sounds-1.html">soundjay.com</a>. If you use Ubuntu or another distribution with GNOME, you can provide a path to one of the default alert sounds, e.g. /usr/share/sounds/gnome/default/alerts/bark.ogg.</p><h4>Play a honk sound on exception</h4><p>Similarly, you can add a hook to play a different sound when an exception is raised. Here is a very simple mechanism proposed by <a href="https://stackoverflow.com/a/41603739/6646912">Kevin at SO</a>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/af3c2602d00b151fe45f59fbbd88e9e0/href">https://medium.com/media/af3c2602d00b151fe45f59fbbd88e9e0/href</a></iframe><p>And of course a more advanced one is part of the jupyter_helpers package:</p><pre>from jupyter_helpers.notifications import Notifications</pre><pre>Notifications(failure_audio=&#39;path/to/beep-05.wav&#39;)</pre><h3>2. Integrate notifications with your OS</h3><p>When working from library I needed an alternative for beeps and honks. Notify-send turned our to be a perfect tool for me as a primarily GNOME user (scroll down for instructions for other desktop environments).<br>To set things up use:</p><pre>from jupyter_helpers.notifications import Notifications</pre><pre>Notifications(<br>    success_audio=&#39;path/to/beep-07.wav&#39;, time_threshold=2,<br>    failure_audio=&#39;path/to/beep-05.wav&#39;,<br>    integration=&#39;GNOME&#39;<br>)</pre><p>This will work out of the box for GNOME users, though installing a drop-in replacement called notify-send.sh will make the notifications go away once they are no longer needed. This can be done with attached setup.sh script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*0e6UWteHV1sTe-IqD8gOmA.gif" /><figcaption>Figure 1: Fully integrated notifications</figcaption></figure><p>The OS integration is ready to be hooked for any other desktop environment, though it will require some scripting:</p><pre>from jupyter_helpers.desktop_integration import DesktopIntegration</pre><pre>class WindowsIntegration(DesktopIntegration):</pre><pre>    def notify(self, title, text, notify_id=None, **kwargs):<br>        pass   # add your code here</pre><pre>    def notify_close(self, notify_id):<br>        pass   # add your code here</pre><pre>Notifications(<br>    success_audio=&#39;path/to/beep-07.wav&#39;, time_threshold=2,<br>    failure_audio=&#39;path/to/beep-05.wav&#39;,<br>    integration=WindowsIntegration<br>)</pre><p>Please consider sending a PR if you wish to integrate it with your OS.</p><h3>3. Jump to definition of a variable/function/class</h3><p>Use Alt + click to jump to a definition using your mouse, or Ctrl + Alt + B keyboard-only alternative with <a href="https://github.com/krassowski/jupyterlab-go-to-definition">jupyterlab-go-to-definition</a> extension:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*zhQaX87SYMmAb95BRpPpWw.gif" /><figcaption>Jump-to-definition supports Python and R. PRs to support other languages are welcome</figcaption></figure><p>Finally, use Alt+ o to jump back to your previous location:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*MxBTo7EXdCiwsVeaAlDnng.gif" /><figcaption>The ability to jump back is quite helpful for notebooks with longer outputs</figcaption></figure><p>To install the extension use:</p><pre>jupyter labextension install @krassowski/jupyterlab_go_to_definition</pre><p>2020 update: even more robust jumping is now available with <a href="https://github.com/krassowski/jupyterlab-lsp">jupyterlab-lsp</a>!</p><h3>4. Enable auto-completion for rpy2 (ggplot2!)</h3><p>If your work is more about publications rather than interactive dashboards, there is a good chance you are familiar with ggplot2. While there are some great projects like plotnine which attempt to port it to Python, I still find working with ggplot (especially the extensions) more feature-complete when using rpy2 R-Python interface.</p><p>However, auto-completion did not include the R objects (nor ggplot functions if loaded) in %%R cells so far. I prepared a simple workaround:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/208ea02f54228461f195c8de29833c31/href">https://medium.com/media/208ea02f54228461f195c8de29833c31/href</a></iframe><p>It may be improved in the future, as discussed in <a href="https://github.com/jupyter/notebook/issues/2528#issuecomment-466499454">this GitHub issue</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*WJwOEA_mMrj5GfP5TYkyiw.gif" /><figcaption>Auto-completion now also includes R objects and ggplot functions</figcaption></figure><p>Again, one simple import from jupyter_helpers will solve the issue:</p><pre>from jupyter_helpers import rpy2_autocompletion</pre><p>2020 update: can now be also accomplished with <a href="https://github.com/krassowski/jupyterlab-lsp">upyterlab-lsp</a>!</p><h3>5. Summarize dictionaries in a nice table view</h3><p>This is not a novel idea, though I hope that sharing my more than less advanced class may help others. This is based on Python3 SimpleNamespace, but extends it with a pandas- and numpy- aware HTML representation for Jupyter:</p><pre>from jupyter_helpers.namespace import NeatNamespace</pre><pre>NeatNamespace(your_dict)</pre><p>Long collections will be trimmed, so no need to worry about the space or running out of memory when browsers struggle to render accidentally printed dictionary. Horizontal and vertical orientations are available for better space utilization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gXmow_ZSvv7BaN2IeY0ZWA.png" /><figcaption>Namespaces with HTML: when nested data needs to be looked at before converting to DataFrame</figcaption></figure><h3>6. Selectively import from other notebooks</h3><p>For some time I was trying to follow data/methods/results separation, having three Jupyter notebooks for each larger analysis: data.ipynb, methods.ipynb and results.ipynb. To save time on useless re-computation of some stuff I wanted to have selective import from <em>data</em> and <em>methods</em> notebooks for use in the <em>results</em> notebook.</p><p>It is now possible (building upon <a href="https://github.com/grst/nbimporter">nbimporter</a>) using one import and a magic:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HWeX3c1rhXXIyy2qIxeHSQ.png" /></figure><p>This was described <a href="https://stackoverflow.com/questions/54317381/selectively-import-from-another-jupyter-notebook">in this SO thread</a>, and I still hope to see some suggestions.</p><h3>7. Scroll to the recently executed cell</h3><p>You may have noticed that previously shown Notifications class made the notebook scroll down on exception to the offending cell (Figure 1). This can be disabled by passing scroll_to_exceptions=False.</p><p>If you conversely, want more auto-scrolling, you could use the underlying helper function to mark the cell that you ended working with at night to quickly open your notebook back on it in the morning:</p><pre>from jupyter_helpers.utilities import scroll_to_current_cell</pre><pre>scroll_to_current_cell(preserve=True)</pre><h3>8. Interactive tail for long outputs</h3><p>Lastly, when running third-party applications (but not being at the point of building a fully-fledged pipeline), one may want to see only the tail of the currently running process. In bash it is easily achieved using tail -f.</p><p>If you can relate to the need of watching the output and problem of it slowing down your computer when being flushed out to your notebook or just generating annoyingly long outputs, FollowingTail helper may be for you:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*JGfa3synC4t4iY5lALCJyw.gif" /><figcaption>Apply tail -f equivalent to keep the outputs at reasonable length!</figcaption></figure><h3>There is more to come!</h3><p>I only had time for so much now, but I will be sharing more of already written and new helpers and snippets. This is a way of giving back to the amazing community of scientific computing (from both Python and R side) which enabled me to complete my thesis. I have another project to come, which will likely require to overcome other challenges.</p><p>Once more is ready I will be sharing the news on Twitter (<a href="https://twitter.com/krassowski_m">@krassowski_m</a>).</p><p>Thank you for reading — hope it was worth writing for at least one researcher.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3614d70c770" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/productivity-tips-for-jupyter-python-a3614d70c770">Productivity tips for Jupyter (Python)</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>