IntroJupyterNotebook

Introduction to Jupyter Notebook

In code cells you can write standard Python:

In [2]:
import math
import csv
In [3]:
x = 4*math.pi
math.sqrt(2**x)
Out[3]:
77.8802336483881

Cell Types

In these cells you can use:

  • Markdown
  • LaTeX

So you can add comments to your code explaining it. For example:

$m = \frac{m_0}{\sqrt{1-v^2/c^2}}$

Two modes

Command mode and Edit mode

In [4]:
import requests
resp = requests.get("https://quentinsf.com")
resp.content
Out[4]:
b'<!doctype html>\n<html>\n\n<head>\n\t<meta name="generator" content="Hugo 0.64.0" />\n    <meta http-equiv="Content-type" content="text/html; charset=utf-8">\n    <meta name="viewport" content="width=device-width, initial-scale=1.0">\n    <meta name="keywords" content="">\n    <meta name="description" content="">\n    <title>\n  About Quentin &ndash; Quentin Stafford-Fraser\n</title>\n    <link rel="shortcut icon" href="/img/favicon.ico">\n\n    <link rel="stylesheet" href="/css/bootstrap.css">\n    <link rel="stylesheet" href="/css/bootstrap-theme.css">\n\n    \n    <link rel="stylesheet" href="/css/styles.css">\n\n    \n\n    <script src="/js/jquery-1.9.1.min.js"></script>\n    <script src="/js/bootstrap.js"></script>\n    <script src="/js/bootstrap-extras.js"></script>\n\n    \n\n    \n\n    \n</head>\n\n<body id="body">\n\n<div id="outer" class="container">\n<div id="header" class="row">\n    <div class="col-xs-3 col-md-3"><a class="site-title" href="/"><span class="glyphicon glyphicon-home" aria-hidden="true"></span></a></div>\n    <div class="col-xs-9 col-md-9 site-title">\n    <a class="site-title" href="/">Quentin Stafford-Fraser</a></div>\n</div>\n\n<div id="topmenu" class="row">\n    \n\n     \n    <div class="col-xs-1 visible-xs">\n    <a role="button"\n    data-toggle="collapse" \n    data-target="#primary-menu" \n    aria-expanded="true" aria-controls="primary-menu">\n    <span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span>\n    </a>\n    </div>\n\n    \n    <div class="col-md-12 col-sm-12 col-xs-5">\n    <ul id="primary-menu" class="nav navbar-nav collapse navbar-collapse">\n    \n    \n        <li class="active">\n            <a href="/">\n                \n                <span>About Quentin</span>\n            </a>\n        </li>\n    \n        <li class="">\n            <a href="/companies/">\n                \n                <span>Companies</span>\n            </a>\n        </li>\n    \n        <li class="">\n            <a href="/writings/">\n                \n                <span>Writing</span>\n            </a>\n        </li>\n    \n        <li class="">\n            <a href="/talks/">\n                \n                <span>Talks &amp; Interviews</span>\n            </a>\n        </li>\n    \n        <li class="">\n            <a href="/research/">\n                \n                <span>Research</span>\n            </a>\n        </li>\n    \n        <li class="">\n            <a href="/personal/">\n                \n                <span>Personal</span>\n            </a>\n        </li>\n    \n        <li class="">\n            <a href="/software/">\n                \n                <span>Software</span>\n            </a>\n        </li>\n    \n        <li class="">\n            <a href="https://statusq.org">\n                \n                <span>Blog</span>\n            </a>\n        </li>\n    \n    <li class="divider-vertical"></li>\n</ul>\n\n    </div>\n\n    \n    <div id="toptree" class="col-xs-6 visible-xs">\n    \n\n\n   <div class="menu-primary-link">About Quentin</div>\n\n\n\n    </div>\n    \n</div>\n\n<div class="row">\n\n\n\n<div id="left-column" class="col-md-2 col-sm-2 hidden-xs">\n    \n    <div id="leftmenu" class="panel panel-default">\n\n\n   <div class="menu-primary-link">About Quentin</div>\n\n\n</div>\n    \n</div>\n\n<div id="main-content" class="main-content col-md-8 col-sm-10 col-xs-12 page">\n\n    \n  <h1 id="about-quentin">About Quentin</h1>\n<p><em>Thanks for visiting my site! There&rsquo;s quite a lot of information here, but I promise I didn&rsquo;t set out to build such a substantial monument to myself online! It just kept growing gradually since around the start of the millennium, and I&rsquo;m not very good at trimming it. So you might appreciate&hellip;</em></p>\n<h2 id="an-executive-summary">An executive summary:</h2>\n<p>I&rsquo;m a computer scientist, entrepreneur, part-time academic and full-time gadget enthusiast based in Cambridge, England.</p>\n<ul>\n<li>\n<p>I&rsquo;m the CEO of a small company called &lsquo;<a href="http://telemarq.com">Telemarq</a>\', which does a mix of software development, tech consultancy, photography, teaching and writing.</p>\n</li>\n<li>\n<p>For the past few years, I&rsquo;ve also held a part-time research post at the <a href="http://www.cl.cam.ac.uk/~qs101/">Cambridge University Computer Lab</a>.  I&rsquo;m currently helping to organise the Lab&rsquo;s interactions with industry and with its alumni, and before that I was working on <a href="/research/endeavour/">the Endeavour project</a>, exploring how computer vision and machine learning can improve the experiences of car drivers. \xc2\xa0Before that, I worked on <a href="/research/pico/" title="Pico">Pico</a>, in the Security group. There&rsquo;s a partial list of my publications <a href="/publications">here</a>.</p>\n</li>\n<li>\n<p>I recently served as the interim Director of Engineering at <a href="https://www.digicatapult.org.uk">the Digital Catapult</a>, while they searched for a permanent, full-time appointee.</p>\n</li>\n<li>\n<p>I have a blog called Status-Q at <a href="https://statusq.org/">statusq.org</a>.</p>\n</li>\n<li>\n<p>You can find me as &lsquo;quentinsf&rsquo; on most online services, and my name makes me easy to search for on others! Keep in touch on <a href="https://twitter.com/quentinsf">Twitter</a>, <a href="https://www.youtube.com/user/quentinsf">YouTube</a>,\xc2\xa0<a href="http://500px.com/quentinsf">500px</a>, <a href="https://photo.telemarq.com">SmugMug</a> and <a href="http://flickr.com/photos/quentinsf">Flickr</a>, <a href="http://uk.linkedin.com/in/quentinsf">LinkedIn</a> and Skype, <a href="https://github.com/quentinsf">GitHub</a> and <a href="http://en.wikipedia.org/wiki/Quentin_Stafford-Fraser">Wikipedia</a>,  <a href="http://scholar.google.co.uk/citations?user=VMoALpsAAAAJ">Google Scholar</a> and <a href="https://www.researchgate.net/profile/Quentin_Stafford-Fraser">ResearchGate</a>. \xc2\xa0You can email me as quentin*@*pobox.com.</p>\n</li>\n<li>\n<p>I have often been credited in the media with inventing the webcam. This is not entirely justified, though I certainly did have something to do with it. You can find the story <a href="/coffeepot/">here</a>.</p>\n</li>\n<li>\n<p>I love gadgets, and have quite a few of them around the house, but the biggest one yet was when I bought <a href="https://statusq.org/archives/2015/11/29/7137/">an electric car</a>!  I&rsquo;ve also become rather fond of home automation, connecting almost everything in my home up through the amazing <a href="https://www.home-assistant.io">Home Assistant</a> system.</p>\n</li>\n<li>\n<p>My previous startup, before Telemarq, was Camvine (Cambridge Visual Networks), a company developing new applications based around networked displays, which I started in 2007. You can read more about Camvine <a href="/companies/camvine/">here</a>.</p>\n</li>\n<li>\n<p>I was also a founder and managing director of the <a href="/companies/ndiyo/">Ndiyo</a> project. This attempted to find new, more affordable network computing architectures for the billions of people who will <em>never</em> be able to afford one PC each.</p>\n</li>\n<li>\n<p>Before that I was working on <a href="/companies/exbiblio/">Exbiblio</a>, which I co-founded in 2004, with the aim of endowing paper documents with some of the power of digital ones.</p>\n</li>\n<li>\n<p>I also co-founded Newnham Research, now <a href="/companies/displaylink/">DisplayLink</a>, in 2003 and was the CEO for its first couple of years.\xc2\xa0</p>\n</li>\n<li>\n<p>I&rsquo;ve authored and/or been listed as an inventor on <a href="/patents/">dozens of patents</a>. None of these have yet made me any money, but they&rsquo;ve done OK for other people! Most are now owned by Google.</p>\n</li>\n<li>\n<p>For several years I was a Research Scientist at AT&amp;T Laboratories Cambridge, UK, the lab which was formerly ORL. You can find out about what I did at AT&amp;T <a href="/research/orl-att/">here</a>.</p>\n</li>\n<li>\n<p>I did <a href="/phd/">a Ph.D. on Augmented Reality</a> in the <a href="http://www.cl.cam.ac.uk/Research/Rainbow/">Rainbow Group</a> at the <a href="http://www.cl.cam.ac.uk/">University of Cambridge Computer Lab</a>. I was sponsored by (and spent much of my time at) Xerox EuroPARC. More details on my research interests can be found <a href="/research/">here</a>.</p>\n</li>\n<li>\n<p>I was, I think, the first full-time Computer Officer at a Cambridge college. During this time, I believe I may have created <a href="/software/venn">the world&rsquo;s first ten-set Venn diagram</a>.</p>\n</li>\n<li>\n<p>If your browser will let you, you can also hear me say <a href="/personal/me.au">hello</a>. <em>(That&rsquo;s a comment that tells you how old the recording is! Not all browsers, or indeed computers, could play audio when I recorded it&hellip;)</em></p>\n</li>\n<li>\n<p>You can find some other personal info <a href="/personal/">here</a>.</p>\n</li>\n<li>\n<p>I think I ran the first web server in Cambridge. I certainly ran the first one in the University, which then became the platform for Computer Science students who wanted to do projects around this new-fangled World Wide Web thing&hellip;</p>\n</li>\n</ul>\n\n\n\n    <div class="row">\n    <div class="breadcrumb">\n    \n    \n        \n            <a href="https://quentinsf.com/"  class="active">Home</a>\n        \n    \n\n\n.\n    <span class="visible-xs-inline mobile-menu-prompt">Click the <span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> button at the top for more.</span>\n    </div>\n    </div>\n\n</div>\n\n<div id="right-column" class="col-md-2 col-sm-12 col-xs-12">\n    <img id="biopic" src="/img/qsf-lab-square.jpg" class="hidden-sm hidden-xs"/>\n    \n    <div class="panel panel-default">\n    <div class="panel-body">\n    \n    \n    </div>\n    </div>\n</div>\n\n\n\n</div>\n\n\n<footer>\n<div>\n  \n    \n\n    <div class="row">\n    <p class="site-info text-center">\n    </p>\n    </div>\n\n</div>\n</footer>\n</div>\n\n\n\n</body>\n</html>\n\n\n'

Some basic operations and keystrokes:

Toggling toolbars.

  • Return and Esc
  • A and B (New cell Above OR Below)
  • X, C, V (Cut, Copy, Paste)
  • DD (Delete)

The different types of Return:

  • Shift-Return (Execute and Exit)
  • Ctrl-Return (Execute and Stay in place)
  • Alt-Return (Execute and Create new cell below)