<?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 Jung Hoon Son, M.D. on Medium]]></title>
        <description><![CDATA[Stories by Jung Hoon Son, M.D. on Medium]]></description>
        <link>https://medium.com/@dr.junghoonson?source=rss-25797313a21c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tSHV8c7LzG4KIF8gLauIpg.jpeg</url>
            <title>Stories by Jung Hoon Son, M.D. on Medium</title>
            <link>https://medium.com/@dr.junghoonson?source=rss-25797313a21c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 04:00:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dr.junghoonson/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[Running VS Code Remote using Google Compute Engine (GCE) VM and Remote SSH (Late 2024 Edition)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@dr.junghoonson/running-vs-code-remote-using-google-compute-engine-gce-vm-and-remote-ssh-late-2024-edition-81dea61b588c?source=rss-25797313a21c------2"><img src="https://cdn-images-1.medium.com/max/2270/1*HE-WyF5445AGvkHXxL5Xaw.png" width="2270"></a></p><p class="medium-feed-snippet">I&#x2019;ve generally entered work environments where VMs were provisioned for us via IT or DevOps&#x200A;&#x2014;&#x200A; whether you work with AWS, Azure, Google&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@dr.junghoonson/running-vs-code-remote-using-google-compute-engine-gce-vm-and-remote-ssh-late-2024-edition-81dea61b588c?source=rss-25797313a21c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@dr.junghoonson/running-vs-code-remote-using-google-compute-engine-gce-vm-and-remote-ssh-late-2024-edition-81dea61b588c?source=rss-25797313a21c------2</link>
            <guid isPermaLink="false">https://medium.com/p/81dea61b588c</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[visual-studio-code]]></category>
            <dc:creator><![CDATA[Jung Hoon Son, M.D.]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 16:27:20 GMT</pubDate>
            <atom:updated>2024-10-18T16:35:13.146Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Getting up and running with LLMs on Apple Silicon (M2 and MLX)]]></title>
            <link>https://medium.com/@dr.junghoonson/getting-up-and-running-with-llms-on-apple-silicon-m2-and-mlx-223cfe2a3413?source=rss-25797313a21c------2</link>
            <guid isPermaLink="false">https://medium.com/p/223cfe2a3413</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[mlx]]></category>
            <category><![CDATA[mac]]></category>
            <dc:creator><![CDATA[Jung Hoon Son, M.D.]]></dc:creator>
            <pubDate>Fri, 20 Sep 2024 17:31:36 GMT</pubDate>
            <atom:updated>2024-09-20T18:39:07.682Z</atom:updated>
            <content:encoded><![CDATA[<p>There are surprisingly few guides for just getting your fresh Apple Silicon (mines M2/10 core), but it’s surprisingly simple to get up and running.</p><p>Real-time speed for the Gemma-2b model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZMi6sTWnzTZC9s65j59PhA.gif" /></figure><h3>Install Homebrew, pyenv, pyenv-virtualenv</h3><pre># Install pyenv and pyenv-virtualenv<br>brew update<br>brew install pyenv pyenv-virtualenv<br><br># Have to make sure the paths are all initialized<br># If you use zsh. For bash gotta edit ~/.zshrc<br>nano ~/.zshrc<br><br># Add these lines at the end of ~/.zshrc, withtout the pound sign<br># eval &quot;$(pyenv init -)&quot;<br># eval &quot;$(pyenv virtualenv-init -)&quot;<br><br># Download Python 3.12.6 available for pyenv<br>pyenv install --list<br>pyenv install 3.12.6<br><br># Create a virtual environment from the version we just installed 3.12.6<br># naming convention is up to you.<br>pyenv virtualenv 3.12.6 llm-3.12.6<br>pyenv virtualenvs<br><br><br><br># Install some necessary packages - I happened to be getting used to<br># uv (poetry is my other option), so this is how you install packages.<br>pyenv activate llm-3.12.6<br>uv pip install mlx-lm huggingface_hub hf_transfer torch<br></pre><h3>Choose a model from Hugging Face’s MLX-ready LLMs</h3><p>Optionally, you can convert them yourself, but for the sake of tutorial, let’s keep it straight forward. There is a HuggingFace <strong>mlx-community </strong>group that seemed to be compiling these nicely.</p><p><a href="https://huggingface.co/collections/mlx-community/google-gemma-65d9b6d041325e422e9cb8bb">Google Gemma - a mlx-community Collection</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DY5GPZKwprYYaGO7m24ePA.png" /></figure><h3>Using your favorite programming environment</h3><p>Make sure the llm-3.12.6 is your Python interpreter.</p><pre>from mlx_lm import load, generate<br><br>model, tokenizer = load(&quot;mlx-community/Phi-3.5-mini-instruct-4bit&quot;)<br>response = generate(model, tokenizer, prompt=&quot;hello&quot;, verbose=True)</pre><h3>Voila… and you are done.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZMi6sTWnzTZC9s65j59PhA.gif" /></figure><h3>Bonus References</h3><p>Github repository for mlx-examples has ton of code examples.</p><p><a href="https://github.com/ml-explore/mlx-examples.git">GitHub - ml-explore/mlx-examples: Examples in the MLX framework</a></p><p>Example: If you want to download Mistral models yourself to convert to MLX compatible model here’s a code example.</p><p><a href="https://github.com/ml-explore/mlx-examples/tree/main/llms/mistral">mlx-examples/llms/mistral at main · ml-explore/mlx-examples</a></p><p>That’s really it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=223cfe2a3413" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplest way to Use Google Cloud + Vertex AI (Gemini) to make a Personal Search API / RAG-LLM]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@dr.junghoonson/simplest-way-to-use-google-cloud-vertex-ai-to-make-a-personal-search-api-rag-llm-54040d04224a?source=rss-25797313a21c------2"><img src="https://cdn-images-1.medium.com/max/1941/1*E8NK2o7F4qezmk0D50hNSA.gif" width="1941"></a></p><p class="medium-feed-snippet">Feels like everyone is complicating this type of search. It doesn&#x2019;t have to be hard when it&#x2019;s a prototype.</p><p class="medium-feed-link"><a href="https://medium.com/@dr.junghoonson/simplest-way-to-use-google-cloud-vertex-ai-to-make-a-personal-search-api-rag-llm-54040d04224a?source=rss-25797313a21c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@dr.junghoonson/simplest-way-to-use-google-cloud-vertex-ai-to-make-a-personal-search-api-rag-llm-54040d04224a?source=rss-25797313a21c------2</link>
            <guid isPermaLink="false">https://medium.com/p/54040d04224a</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[generative]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Jung Hoon Son, M.D.]]></dc:creator>
            <pubDate>Sat, 18 May 2024 23:35:01 GMT</pubDate>
            <atom:updated>2024-05-19T18:05:23.617Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Configuring Github Pages for Deployment-Ready Website with Observable Framework]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@dr.junghoonson/configuring-github-pages-for-deployment-ready-website-with-observable-framework-43c08b74ba45?source=rss-25797313a21c------2"><img src="https://cdn-images-1.medium.com/max/2600/1*Relr2jkahGXUaE5y6CSY-A.png" width="2860"></a></p><p class="medium-feed-snippet">Github Pages is one of the easiest / fastest ways get your repositories deployed, but it does need some configuration which takes some&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@dr.junghoonson/configuring-github-pages-for-deployment-ready-website-with-observable-framework-43c08b74ba45?source=rss-25797313a21c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@dr.junghoonson/configuring-github-pages-for-deployment-ready-website-with-observable-framework-43c08b74ba45?source=rss-25797313a21c------2</link>
            <guid isPermaLink="false">https://medium.com/p/43c08b74ba45</guid>
            <category><![CDATA[observable-framework]]></category>
            <category><![CDATA[github-pages]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[observablehq]]></category>
            <dc:creator><![CDATA[Jung Hoon Son, M.D.]]></dc:creator>
            <pubDate>Tue, 16 Apr 2024 23:49:53 GMT</pubDate>
            <atom:updated>2024-04-16T23:50:03.775Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Using Quarto to Create Interactive Data Visualizations using Python, R, and Observable]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@dr.junghoonson/using-quarto-to-create-interactive-data-visualizations-using-python-r-and-observable-57971390a9e9?source=rss-25797313a21c------2"><img src="https://cdn-images-1.medium.com/max/1930/1*DjHrN_qdzlVhXwj0o1YCDg.png" width="1930"></a></p><p class="medium-feed-snippet">Quarto&#x2019;s Markdown-based system.
Python&#x2019;s data processing prowess.
R&#x2019;s data presentation libraries.
Observable&#x2019;s dynamic widgets.
The&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@dr.junghoonson/using-quarto-to-create-interactive-data-visualizations-using-python-r-and-observable-57971390a9e9?source=rss-25797313a21c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@dr.junghoonson/using-quarto-to-create-interactive-data-visualizations-using-python-r-and-observable-57971390a9e9?source=rss-25797313a21c------2</link>
            <guid isPermaLink="false">https://medium.com/p/57971390a9e9</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[r-programming]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[publishing]]></category>
            <dc:creator><![CDATA[Jung Hoon Son, M.D.]]></dc:creator>
            <pubDate>Sat, 24 Feb 2024 14:22:33 GMT</pubDate>
            <atom:updated>2024-02-24T14:36:15.310Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Using Altair to Build a Dynamic, Interactive Choropleth Map]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@dr.junghoonson/using-altair-to-building-dynamic-interactive-choropleth-maps-8e7e8b051227?source=rss-25797313a21c------2"><img src="https://cdn-images-1.medium.com/max/1096/1*r1t0Y4ovb7V2vwJ_eNbWhw.png" width="1096"></a></p><p class="medium-feed-snippet">Altair and Vega have been beefing up geomapping capabilities. Choropleth maps are simple ways to show geographic patterns by adding colors&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@dr.junghoonson/using-altair-to-building-dynamic-interactive-choropleth-maps-8e7e8b051227?source=rss-25797313a21c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@dr.junghoonson/using-altair-to-building-dynamic-interactive-choropleth-maps-8e7e8b051227?source=rss-25797313a21c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e7e8b051227</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[altair]]></category>
            <dc:creator><![CDATA[Jung Hoon Son, M.D.]]></dc:creator>
            <pubDate>Tue, 20 Feb 2024 03:26:11 GMT</pubDate>
            <atom:updated>2024-02-20T03:44:17.745Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[MTA Subway Lines Data Visualization Using Altair: Step-by-Step Guide]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://python.plainenglish.io/mta-subway-lines-data-visualization-using-altair-step-by-step-guide-ae576f3b845c?source=rss-25797313a21c------2"><img src="https://cdn-images-1.medium.com/max/1722/1*3H2K3lXdd0VYRfdHDDU3aQ.gif" width="1722"></a></p><p class="medium-feed-snippet">Promise this is not your standard MTA Data Visualization</p><p class="medium-feed-link"><a href="https://python.plainenglish.io/mta-subway-lines-data-visualization-using-altair-step-by-step-guide-ae576f3b845c?source=rss-25797313a21c------2">Continue reading on Python in Plain English »</a></p></div>]]></description>
            <link>https://python.plainenglish.io/mta-subway-lines-data-visualization-using-altair-step-by-step-guide-ae576f3b845c?source=rss-25797313a21c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae576f3b845c</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[transportation]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[altair]]></category>
            <dc:creator><![CDATA[Jung Hoon Son, M.D.]]></dc:creator>
            <pubDate>Tue, 19 Sep 2023 13:30:22 GMT</pubDate>
            <atom:updated>2023-09-21T02:14:04.753Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Using OpenAI API for multiple parsing / information extraction tasks in Python (using a biomedical…]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@dr.junghoonson/using-openai-api-to-batch-extract-multiple-parsing-tasks-in-python-using-a-biomedical-example-598ce17e042c?source=rss-25797313a21c------2"><img src="https://cdn-images-1.medium.com/max/1490/1*-96IwQjLg_Rel7TdSQyEnQ.png" width="1490"></a></p><p class="medium-feed-snippet">Dealing with tedious, repetitive biomedical tasks using LLM in Python</p><p class="medium-feed-link"><a href="https://medium.com/@dr.junghoonson/using-openai-api-to-batch-extract-multiple-parsing-tasks-in-python-using-a-biomedical-example-598ce17e042c?source=rss-25797313a21c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@dr.junghoonson/using-openai-api-to-batch-extract-multiple-parsing-tasks-in-python-using-a-biomedical-example-598ce17e042c?source=rss-25797313a21c------2</link>
            <guid isPermaLink="false">https://medium.com/p/598ce17e042c</guid>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[biomedical]]></category>
            <category><![CDATA[clinical-trials]]></category>
            <dc:creator><![CDATA[Jung Hoon Son, M.D.]]></dc:creator>
            <pubDate>Sat, 09 Sep 2023 12:01:15 GMT</pubDate>
            <atom:updated>2023-09-09T14:41:35.426Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Simplest Way to publish your Jupyter notebooks on the open web: Using jupyter-book and GitHub Pages]]></title>
            <link>https://medium.com/@dr.junghoonson/simplest-way-to-publish-your-jupyter-notebooks-on-the-open-web-using-jupyter-book-and-github-pages-eea144031d6f?source=rss-25797313a21c------2</link>
            <guid isPermaLink="false">https://medium.com/p/eea144031d6f</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <dc:creator><![CDATA[Jung Hoon Son, M.D.]]></dc:creator>
            <pubDate>Sat, 26 Aug 2023 19:46:13 GMT</pubDate>
            <atom:updated>2023-08-27T13:03:40.681Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data science/analysis code is often unseen</h3><p>This is my pet peeve.</p><p>Too many data scientists write code on Jupyter Notebook which ends up never seeing the light of day, because your boss, upper management, and C-suites doesn’t know (or often times, don’t need to care) about how to access:</p><ul><li>Jupyter server</li><li>Github</li><li>VPN to your latest cloud VM</li><li>Stuck behind someone’s Powerpoint/Excel, does not do your work justice</li></ul><p>Let’s change that, to prevent analytics techniques to become next scientific publishing wall, shrouded in intellectual property and copyright risks. Open data techniques will protect everyone.</p><h3>Prerequisites</h3><ul><li>Jupyter file(s) you want to publish</li><li>GitHub/Git experience</li><li>Basic command-line interface</li><li>Basic-to-intermediate understanding of Markdown</li></ul><h3>Optional</h3><ul><li>Knowledge of Sphinx (I personally never worked with this)</li></ul><h3><strong>[Optional: Step 0] Create your repository and add your notebooks.</strong></h3><blockquote>If you already have Github repository and Jupyter setup, skip to <strong>Step 1</strong></blockquote><p>I created one named jupyter-book-tutorialusing Github</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*So9K1AIbdXxl8IuRYyP49A.png" /></figure><h3>[Optional: Step 0b] Use Github Codespaces for Editing</h3><p>Using Github’s Codespaces will spare you of a lot of headaches in setting up python environments. Github is owned by Microsoft, and it basically launches a web-ready VS Code editor.</p><p>To setup a a free coding environment directly using Codespaces:</p><p>Click + button on top right → &quot;New codespace&quot; → Select your jupyter-book-tutorial repository. And voila — you have a default linux environment that includes some basic Javascript, Python, Docker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Geh6CVGl7OVk8YQNpUPEw.gif" /></figure><h3>Step 1: Install Poetry</h3><blockquote>I was contemplating making this step optional, but I want to encourage data scientists get better at python package management.</blockquote><p><strong>Poetry</strong> is a python package manager that’ll make future dependency management a lot easier, so it’s good to get used to using it (pip / requirements.txt route will cause problems when you start working with larger teams). The following command will install poetry for the global python environment for this <strong>Codespaces </strong>instance.</p><p>pip install -U poetry from the <strong>Codespaces</strong> terminal</p><h4><strong>In Terminal:</strong></h4><pre>pip install -U poetry</pre><h4>Output:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uyqnq1AuQ24EmpdZJM2teA.png" /></figure><h3>Step 2: Initialize the repository with poetry</h3><h4>In Terminal:</h4><pre>poetry init</pre><p>It’ll ask a few questions to setup the package. Default is to press <strong>Enter.</strong></p><p>When it asks to define your main dependencies → Type in “<strong>no</strong>”</p><h4>Output:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K2GXOjbvYcjIIbckma_R3w.png" /></figure><p>What you just did was to create a way for the repository to keep track of what packages are needed, like requirement.txt that often exists with pip . But python package management can be dealt with other time.</p><h3>Step 3: Install necessary python packages</h3><ul><li>jupyter-book (<a href="https://jupyterbook.org/en/stable/intro.html">https://jupyterbook.org/en/stable/intro.html</a>)</li><li>ipykernel</li><li>ghp-import (easy way to push to GitHub Pages)</li></ul><p>My Jupyter notebook examples will use:</p><ul><li>pandas</li><li>polars</li><li>altair</li><li>plotly</li><li>vega_datasets (sample datasets for Altair)</li></ul><p>If you are used to pip install for poetry, you need to change that to poetry add</p><h4>In Terminal:</h4><pre>poetry add jupyter-book ipykernel pandas polars altair plotly ghp-import vega_datasets</pre><h4>Output:</h4><p>Once it runs, your window should look like this. Poetry will be keeping track of what’s installed in a file called pyproject.toml (generally don’t need to touch this, that’s what poetry is working with and managing)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PH0U_-wHusEUfB0d2NRXOA.png" /></figure><h3>Step 4: Setup the basic template for jupyter-book</h3><p><strong>jupyter-book (</strong><a href="https://jupyterbook.org/en/stable/intro.html">https://jupyterbook.org/en/stable/intro.htm)</a> is a Sphinx based “document system” for basically parsing your Markdown files, Jupyter notebooks. Think of it as a file translator for the files to more openly sharable HTML, PDF.</p><h4>In Terminal:</h4><blockquote>Make sure you are in your repository directory<br>Mine is<strong> /workspaces/jupyter-book-tutorial/</strong></blockquote><p>I personally have a habit of running poetry run rather than opening up a shell within the environment. (So bear with me, or optionally run poetry shell to activate the environment if you want to not repeat that command.)</p><pre>cd /workspaces/jupyter-book-tutorial/<br>poetry run jupyter-book create myfirstbook/</pre><h4>Output:</h4><p>It’ll create a template scaffolding with examples. We will edit some of these later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sMnJQxiyR14AobnztTadKw.png" /></figure><h3>Step 5: Publish to GitHub Pages (using ghp-import)</h3><p>Even though the template has been created, we’ll need jupyter-book to generate some of the HTML files we need for making it publishable.</p><p>This requires seemingly complex steps, but requires:</p><ol><li>Build the book to HTML</li><li>Make the generated files change available on the main branch of your Github repo</li><li>GitHub Pages works by loading web-ready HTML files on separate git branch called gh-pages . This step can be made easy by using ghp-import repository we installed earlier.</li></ol><h4>In Terminal:</h4><pre>poetry run jupyter-book build myfirstbook<br>git add -A<br>git commit -m &quot;publish&quot;<br>git push<br>poetry run ghp-import -n -p -f myfirstbook/_build/html</pre><h3>Step 6: Check your website!</h3><p>This step may take ~2 minutes but once the git branch is all set up, try accessing your new website:</p><p><a href="https://plasmak11.github.io/jupyter-book-tutorial">https://[username].github.io/[repository-name]</a></p><p>(e.g. mine is on <a href="https://plasmak11.github.io/jupyter-book-tutorial">https://plasmak11.github.io/jupyter-book-tutorial</a>)</p><h4>Output:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5jeZxNOM-WYkrcZYIT0ejg.png" /></figure><h3>Step 7: Let’s create/add your Jupyter notebook</h3><p>I have a notebook that is just a copy-pasta version of the Altair’s data chart: <a href="https://altair-viz.github.io/gallery/natural_disasters.html">https://altair-viz.github.io/gallery/natural_disasters.html</a></p><p>My Example notebook is located in:</p><p>myfirstbook/altair-intro.ipynb</p><h4>altair-intro.ipynb</h4><blockquote><strong>All notebooks will need a “Markdown” cell with at least one heading (hashtag)</strong></blockquote><p>The following is my bear minimum Jupyter notebook:</p><pre># Altair Intro</pre><pre>import altair as alt<br>from vega_datasets import data<br><br>source = data.disasters.url<br><br>alt.Chart(source).transform_filter(<br>    alt.datum.Entity != &#39;All natural disasters&#39;<br>).mark_circle(<br>    opacity=0.8,<br>    stroke=&#39;black&#39;,<br>    strokeWidth=1,<br>    strokeOpacity=0.4<br>).encode(<br>    x=alt.X(&#39;Year:T&#39;, title=None, scale=alt.Scale(domain=[&#39;1899&#39;,&#39;2018&#39;])),<br>    y=alt.Y(<br>        &#39;Entity:N&#39;,<br>        sort=alt.EncodingSortField(field=&quot;Deaths&quot;, op=&quot;sum&quot;, order=&#39;descending&#39;),<br>        title=None<br>    ),<br>    size=alt.Size(&#39;Deaths:Q&#39;,<br>        scale=alt.Scale(range=[0, 2500]),<br>        legend=alt.Legend(title=&#39;Deaths&#39;, clipHeight=30, format=&#39;s&#39;)<br>    ),<br>    color=alt.Color(&#39;Entity:N&#39;, legend=None),<br>    tooltip=[<br>        &quot;Entity:N&quot;,<br>        alt.Tooltip(&quot;Year:T&quot;, format=&#39;%Y&#39;),<br>        alt.Tooltip(&quot;Deaths:Q&quot;, format=&#39;~s&#39;)<br>    ],<br>).properties(<br>    width=450,<br>    height=320,<br>    title=alt.Title(<br>        text=&quot;Global Deaths from Natural Disasters (1900-2017)&quot;,<br>        subtitle=&quot;The size of the bubble represents the total death count per year, by type of disaster&quot;,<br>        anchor=&#39;start&#39;<br>    )<br>).configure_axisY(<br>    domain=False,<br>    ticks=False,<br>    offset=10<br>).configure_axisX(<br>    grid=False,<br>).configure_view(<br>    stroke=None<br>)</pre><p>To ensure you can work in Codespaces is set up with Python + Jupyter, “Select Kernel” button and make sure to choose “Python Environment” that is <strong>NOT</strong> in ~/.python/current/bin/python3 but partially corresponds to the repository name.</p><p><strong>Output</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pba6riAVntFtQe5oRMf2kQ.gif" /></figure><h3>Step 8: Add your new Notebook to Table of contents</h3><p>You’ll find a filename _toc.yml</p><p>Original _toc.yml</p><pre># Table of contents<br># Learn more at https://jupyterbook.org/customize/toc.html<br><br>format: jb-book<br>root: intro<br>chapters:<br>- file: markdown<br>- file: notebooks<br>- file: markdown-notebooks</pre><p>Let’s get rid of all the entries on the bottom, and add your new file, altair-intro.ipynb</p><p>New _tol.yml</p><pre># Table of contents<br># Learn more at https://jupyterbook.org/customize/toc.html<br><br>format: jb-book<br>root: intro<br>chapters:<br>- file: altair-intro.ipynb</pre><h3>Step 9: Final Step: Publish again!</h3><p>In terminal, let’s run our lazy script again:</p><pre>poetry run jupyter-book build myfirstbook<br>git add -A<br>git commit -m &quot;publish&quot;<br>git push<br>poetry run ghp-import -n -p -f myfirstbook/_build/html</pre><blockquote>[Optional, 1 liner for easier copy and paste]:</blockquote><pre>poetry run jupyter-book build myfirstbook &amp;&amp;  git add -A &amp;&amp; git commit -m &quot;publish&quot; &amp;&amp; git push &amp;&amp; poetry run ghp-import -n -p -f myfirstbook/_build/html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EaEcTruP50ym6zqurcWVBA.gif" /></figure><h3>Final words</h3><p>There are a ton of customizations, themes for jupyter-book and Sphinx.</p><ul><li>Organizing the Table of Contents ( _toc.yml)</li><li>Configurations (themes, add-ons) for Sphinx engine</li><li>And the modern improvements of Markdown “MyST” (Markedly Structured Text) which Jupyter-book uses.</li></ul><p>I am planning to write more on <a href="https://jupyterbook.org/en/stable/content/myst.html">Jupyter-books</a> and <a href="https://altair-viz.github.io/gallery/index.html">Altair</a> in the future, so give me a follow if you are interested.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eea144031d6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>