thierry-bombardier/post/jupyter/index.html
2022-03-24 15:46:02 +01:00

929 lines
21 KiB
HTML

<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Source Themes Academia 4.3.1">
<meta name="generator" content="Hugo 0.89.4" />
<meta name="author" content="Michael Vahn">
<meta name="description" content="Learn how to blog in academia using Jupyter notebooks">
<link rel="alternate" hreflang="en-us" href="/portfolios/exemple2/post/jupyter/">
<meta name="theme-color" content="#fc6f5c">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.8.6/css/academicons.min.css" integrity="sha256-uFVgMKfistnJAfoCUQigIl+JfUaP47GrRKjf6CTPVmw=" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.0/css/all.css" integrity="sha384-aOkxzJ5uQz7WBObEZcHvV5JvRW3TUc2rNPA7pe3AwnsUohiw1Vj2Rgx2KSOkF5+h" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.5/jquery.fancybox.min.css" integrity="sha256-ygkqlh3CYSUri3LhQxzdcm0n1EQvH2Y+U5S2idbLtxs=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/github.min.css" crossorigin="anonymous" title="hl-light">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/dracula.min.css" crossorigin="anonymous" title="hl-dark" disabled>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.css" integrity="sha512-M2wvCLH6DSRazYeZRIm1JnYyh22purTM+FDB5CsyxtQJYeKq83arPe5wgbNmcFXGqiSH2XR8dT/fJISVA1r/zQ==" crossorigin="anonymous">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700|Open+Sans|Roboto+Mono&display=swap">
<link rel="stylesheet" href="/portfolios/exemple2/css/academia.min.76e69f7370e1e1222344c0109d841c44.css">
<link rel="manifest" href="/portfolios/exemple2/site.webmanifest">
<link rel="icon" type="image/png" href="/portfolios/exemple2/img/icon.png">
<link rel="apple-touch-icon" type="image/png" href="/portfolios/exemple2/img/icon-192.png">
<link rel="canonical" href="/portfolios/exemple2/post/jupyter/">
<meta property="twitter:card" content="summary_large_image">
<meta property="og:site_name" content="Léa Jean">
<meta property="og:url" content="/portfolios/exemple2/post/jupyter/">
<meta property="og:title" content="Display Jupyter Notebooks with academia | Léa Jean">
<meta property="og:description" content="Learn how to blog in academia using Jupyter notebooks"><meta property="og:image" content="/portfolios/exemple2/post/jupyter/featured.jpg">
<meta property="twitter:image" content="/portfolios/exemple2/post/jupyter/featured.jpg"><meta property="og:locale" content="en-us">
<meta property="article:published_time" content="2019-02-05T00:00:00&#43;00:00">
<meta property="article:modified_time" content="2019-02-05T00:00:00&#43;00:00">
<title>Display Jupyter Notebooks with academia | Léa Jean</title>
</head>
<body id="top" data-spy="scroll" data-target="#TableOfContents" data-offset="71" >
<aside class="search-results" id="search">
<div class="container">
<section class="search-header">
<div class="row no-gutters justify-content-between mb-3">
<div class="col-6">
<h1>Search</h1>
</div>
<div class="col-6 col-search-close">
<a class="js-search" href="#"><i class="fas fa-times-circle text-muted" aria-hidden="true"></i></a>
</div>
</div>
<div id="search-box">
</div>
</section>
<section class="section-search-results">
<div id="search-hits">
</div>
</section>
</div>
</aside>
<nav class="navbar navbar-light fixed-top navbar-expand-lg py-0" id="navbar-main">
<div class="container">
<a class="navbar-brand" href="/portfolios/exemple2/">Léa Jean</a>
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"><span><i class="fas fa-bars"></i></span>
</button>
<div class="collapse navbar-collapse" id="navbar">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link " href="/portfolios/exemple2/#about"><span>Home</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/portfolios/exemple2/#posts"><span>Posts</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/portfolios/exemple2/#projects"><span>Projects</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/portfolios/exemple2/#publications"><span>Publications</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/portfolios/exemple2/courses/"><span>Courses</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/portfolios/exemple2/#contact"><span>Contact</span></a>
</li>
<li class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"><span>dropdown</span><span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li class="dropdown-item my-0 py-0 mx-0 px-0">
<a href="/portfolios/exemple2/#"><span>dropdown 1</span></a>
</li>
<li class="dropdown-item my-0 py-0 mx-0 px-0">
<a href="/portfolios/exemple2/#!"><span>dropdown 2</span></a>
</li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link js-dark-toggle" href="#"><i class="fas fa-moon" aria-hidden="true"></i></a>
</li>
</ul>
</div>
</div>
</nav>
<article class="article py-5" itemscope itemtype="http://schema.org/Article">
<div class="container split-header">
<div class="row justify-content-center">
<div class="col-lg-8">
<img class="img-fluid w-100" src="/portfolios/exemple2/post/jupyter/featured_hu17228671acc7297decf3359d3864d9fb_379701_680x500_fill_q90_lanczos_smart1.jpg" itemprop="image" alt="">
<span
class="article-header-caption">Image credit: <a href="https://unsplash.com/photos/CpkOjOcXdUY"><strong>Unsplash</strong></a></span>
</div>
<div class="col-lg-8">
<h1 itemprop="name">Display Jupyter Notebooks with academia</h1>
<p class="page-subtitle">Learn how to blog in academia using Jupyter notebooks</p>
<meta content="2019-02-05 00:00:00 &#43;0000 UTC" itemprop="datePublished">
<meta content="2019-02-05 00:00:00 &#43;0000 UTC" itemprop="dateModified">
<div class="article-metadata">
<div>
<span itemprop="author name" itemtype="http://schema.org/Person"><a href="/portfolios/exemple2/authors/admin/">Michael Vahn</a></span>
</div>
<span class="article-date">
<time>Feb 5, 2019</time>
</span>
<span class="middot-divider"></span>
<span class="article-reading-time">
1 min read
</span>
<div class="share-box" aria-hidden="true">
<ul class="share">
<li>
<a href="https://twitter.com/intent/tweet?url=/portfolios/exemple2/post/jupyter/&amp;text=Display%20Jupyter%20Notebooks%20with%20academia" target="_blank" rel="noopener" class="share-btn-twitter">
<i class="fab fa-twitter"></i>
</a>
</li>
<li>
<a href="https://www.facebook.com/sharer.php?u=/portfolios/exemple2/post/jupyter/&amp;t=Display%20Jupyter%20Notebooks%20with%20academia" target="_blank" rel="noopener" class="share-btn-facebook">
<i class="fab fa-facebook-f"></i>
</a>
</li>
<li>
<a href="mailto:?subject=Display%20Jupyter%20Notebooks%20with%20academia&amp;body=/portfolios/exemple2/post/jupyter/" target="_blank" rel="noopener" class="share-btn-email">
<i class="fas fa-envelope"></i>
</a>
</li>
<li>
<a href="https://www.linkedin.com/shareArticle?url=/portfolios/exemple2/post/jupyter/&amp;title=Display%20Jupyter%20Notebooks%20with%20academia" target="_blank" rel="noopener" class="share-btn-linkedin">
<i class="fab fa-linkedin-in"></i>
</a>
</li>
<li>
<a href="https://web.whatsapp.com/send?text=Display%20Jupyter%20Notebooks%20with%20academia%20/portfolios/exemple2/post/jupyter/" target="_blank" rel="noopener" class="share-btn-whatsapp">
<i class="fab fa-whatsapp"></i>
</a>
</li>
<li>
<a href="https://service.weibo.com/share/share.php?url=/portfolios/exemple2/post/jupyter/&amp;title=Display%20Jupyter%20Notebooks%20with%20academia" target="_blank" rel="noopener" class="share-btn-weibo">
<i class="fab fa-weibo"></i>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="article-container">
<div class="article-style" itemprop="articleBody">
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-python" data-lang="python"><span style="color:#f92672">from</span> IPython.core.display <span style="color:#f92672">import</span> Image
Image(<span style="color:#e6db74">&#39;https://www.python.org/static/community_logos/python-logo-master-v3-TM-flattened.png&#39;</span>)
</code></pre></div><p><img src="./academia_0_0.png" alt="png"></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-python" data-lang="python">print(<span style="color:#e6db74">&#34;Welcome to academia!&#34;</span>)
</code></pre></div><pre><code>Welcome to academia!
</code></pre>
<h2 id="install-python-and-jupyter">Install Python and Jupyter</h2>
<p><a href="https://www.anaconda.com/distribution/#download-section">Install Anaconda</a> which includes Python 3 and Jupyter notebook.</p>
<p>Otherwise, for advanced users, install Jupyter notebook with <code>pip3 install jupyter</code>.</p>
<h2 id="create-a-new-blog-post-as-usualhttpssourcethemescomacademicdocsmanaging-contentcreate-a-blog-post">Create a new blog post <a href="https://sourcethemes.com/academic/docs/managing-content/#create-a-blog-post">as usual</a></h2>
<p>Run the following commands in your Terminal, substituting <code>&lt;MY_WEBSITE_FOLDER&gt;</code> and <code>my-post</code> with the file path to your academia website folder and a name for your blog post (without spaces), respectively:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">cd &lt;MY_WEBSITE_FOLDER&gt;
hugo new --kind post post/my-post
cd &lt;MY_WEBSITE_FOLDER&gt;/content/post/my-post/
</code></pre></div><h2 id="create-or-upload-a-jupyter-notebook">Create or upload a Jupyter notebook</h2>
<p>Run the following command to start Jupyter within your new blog post folder. Then create a new Jupyter notebook (<em>New &gt; Python Notebook</em>) or upload a notebook.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">jupyter notebook
</code></pre></div><h2 id="convert-notebook-to-markdown">Convert notebook to Markdown</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">jupyter nbconvert Untitled.ipynb --to markdown --NbConvertApp.output_files_dir<span style="color:#f92672">=</span>.
<span style="color:#75715e"># Copy the contents of Untitled.md and append it to index.md:</span>
cat Untitled.md | tee -a index.md
<span style="color:#75715e"># Remove the temporary file:</span>
rm Untitled.md
</code></pre></div><h2 id="edit-your-post-metadata">Edit your post metadata</h2>
<p>Open <code>index.md</code> in your text editor and edit the title etc. in the <a href="https://sourcethemes.com/academic/docs/front-matter/">front matter</a> according to your preference.</p>
<p>To set a <a href="https://sourcethemes.com/academic/docs/managing-content/#featured-image">featured image</a>, place an image named <code>featured</code> into your post&rsquo;s folder.</p>
<p>For other tips, such as using math, see the guide on <a href="https://sourcethemes.com/academic/docs/writing-markdown-latex/">writing content with academia</a>.</p>
</div>
<div class="media author-card" itemscope itemtype="http://schema.org/Person">
<div class="media-body">
<h5 class="card-title" itemprop="name"><a href="/portfolios/exemple2/">Michael Vahn</a></h5>
<h6 class="card-subtitle">Professor of Artificial Intelligence</h6>
<p class="card-text" itemprop="description">My research interests include distributed robotics, mobile computing and programmable matter.</p>
<ul class="network-icon" aria-hidden="true">
<li>
<a itemprop="sameAs" href="/portfolios/exemple2/#contact" >
<i class="fas fa-envelope"></i>
</a>
</li>
<li>
<a itemprop="sameAs" href="https://twitter.com/GeorgeCushen" target="_blank" rel="noopener">
<i class="fab fa-twitter"></i>
</a>
</li>
<li>
<a itemprop="sameAs" href="https://scholar.google.co.uk/citations?user=sIwtMXoAAAAJ" target="_blank" rel="noopener">
<i class="ai ai-google-scholar"></i>
</a>
</li>
<li>
<a itemprop="sameAs" href="https://github.com/gcushen" target="_blank" rel="noopener">
<i class="fab fa-github"></i>
</a>
</li>
</ul>
</div>
</div>
</div>
</article>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/4.1.4/imagesloaded.pkgd.min.js" integrity="sha256-lqvxZrPLtfffUl2G/e7szqSvPBILGbwmsGE1MKlOi0Q=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.6/isotope.pkgd.min.js" integrity="sha256-CBrpuqrMhXwcLLUd5tvQ4euBHCdh7wGlDfNz8vbu/iI=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.5/jquery.fancybox.min.js" integrity="sha256-X5PoE3KU5l+JcX+w09p/wHl9AzK333C4hJ2I9S5mD4M=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js" integrity="sha256-aYTdUrn6Ow1DDgh5JTc3aDGnnju48y/1c8s1dgkYPQ8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.js" integrity="sha512-lInM/apFSqyy1o6s89K4iQUKg6ppXEgsVxT35HbzUupEVRh2Eu9Wdl4tHj7dZO0s1uvplcYGmt3498TtHq+log==" crossorigin="anonymous"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/portfolios/exemple2/js/academia.min.e40e230d9b3dfeac86994156b6388764.js"></script>
<div class="container">
<footer class="site-footer">
<div class="container">
<div class="row align-items-center">
<div class="col-md-6 mb-4 mb-md-0">
<p class="mb-0">
Copyright © 2021 &middot;
Powered by
<a href="https://gethugothemes.com" target="_blank" rel="noopener">Gethugothemes</a>
</p>
</div>
<div class="col-md-6">
<ul class="list-inline network-icon text-right mb-0">
<li class="list-inline-item">
<a href="https://twitter.com/Twitter" target="_blank" rel="noopener" title="DM Me"><i class="fab fa-twitter" aria-hidden="true"></i></a>
</li>
<li class="list-inline-item">
<a href="skype:echo123?call" title="Skype Me"><i class="fab fa-skype" aria-hidden="true"></i></a>
</li>
<li class="list-inline-item">
<a href="https://keybase.io/" target="_blank" rel="noopener" title="Chat on Keybase"><i class="fab fa-keybase" aria-hidden="true"></i></a>
</li>
<li class="list-inline-item">
<a href="https://discourse.gohugo.io" target="_blank" rel="noopener" title="Discuss on Forum"><i class="fas fa-comments" aria-hidden="true"></i></a>
</li>
</ul>
</div>
</div>
</div>
</footer>
</div>
<div id="modal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Cite</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<pre><code class="tex hljs"></code></pre>
</div>
<div class="modal-footer">
<a class="btn btn-outline-primary my-1 js-copy-cite" href="#" target="_blank">
<i class="fas fa-copy"></i> Copy
</a>
<a class="btn btn-outline-primary my-1 js-download-cite" href="#" target="_blank">
<i class="fas fa-download"></i> Download
</a>
<div id="modal-error"></div>
</div>
</div>
</div>
</div>
</body>
</html>