People love to hate @ProjectJupyter notebooks!

They& #39;re missing out on a great communication tool.

Here& #39;s how data scientists and machine learners can
build great Jupyter Notebooks that people love to read

https://abs.twimg.com/emoji/v2/... draggable="false" alt="👇" title="Rug van hand met omlaag wijzende wijsvinger" aria-label="Emoji: Rug van hand met omlaag wijzende wijsvinger"> https://abs.twimg.com/emoji/v2/... draggable="false" alt="🧵" title="collectie" aria-label="Emoji: collectie">
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🧮" title="Abacus" aria-label="Emoji: Abacus"> Fix your dang code

You can make a mess in notebooks when experimenting.

https://abs.twimg.com/emoji/v2/... draggable="false" alt="1️⃣" title="Nummertoets een" aria-label="Emoji: Nummertoets een">All Imports into Cell 1
https://abs.twimg.com/emoji/v2/... draggable="false" alt="2️⃣" title="Nummertoets twee" aria-label="Emoji: Nummertoets twee">Extract some functions and classes
https://abs.twimg.com/emoji/v2/... draggable="false" alt="3️⃣" title="Nummertoets drie" aria-label="Emoji: Nummertoets drie">Comments.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="4️⃣" title="Nummertoets vier" aria-label="Emoji: Nummertoets vier">Fix your variable names
https://abs.twimg.com/emoji/v2/... draggable="false" alt="5️⃣" title="Nummertoets vijf" aria-label="Emoji: Nummertoets vijf">Fix the order and outputs
https://abs.twimg.com/emoji/v2/... draggable="false" alt="6️⃣" title="Nummertoets zes" aria-label="Emoji: Nummertoets zes">Use black to standardize your code format https://github.com/drillan/jupyter-black">https://github.com/drillan/j...
https://abs.twimg.com/emoji/v2/... draggable="false" alt="✒️" title="Vulpen" aria-label="Emoji: Vulpen"> Jupyter has Markdown Cells!

Use them.
If you& #39;re not using Markdown in your Notebooks, you should not be using Notebooks.

Write some prose to explain your code.
Whether analysis or model,
do yourself a favour and document it.

Here& #39;s a markdown guide: https://www.markdownguide.org/getting-started/">https://www.markdownguide.org/getting-s...
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🔂" title="Met de klok mee naar rechts en links open gecirkelde pijlen met omcirkelde één als overlapping" aria-label="Emoji: Met de klok mee naar rechts en links open gecirkelde pijlen met omcirkelde één als overlapping"> Final checks

We all do it.

We forget to run a cell and wonder for an embarrassing amount of time, why we have an error in the next one.

Before you share your notebook:
https://abs.twimg.com/emoji/v2/... draggable="false" alt="1️⃣" title="Nummertoets een" aria-label="Emoji: Nummertoets een">Restart Kernel to forget all variables
https://abs.twimg.com/emoji/v2/... draggable="false" alt="2️⃣" title="Nummertoets twee" aria-label="Emoji: Nummertoets twee">Run All Cells

Not by hand. Automatic.
It& #39;ll show any mix-ups
If this thread was informative
make sure to follow @jesperdramsch

and share the first tweet https://abs.twimg.com/emoji/v2/... draggable="false" alt="☝" title="Omhoog wijzende wijsvinger" aria-label="Emoji: Omhoog wijzende wijsvinger"> for others to learn!

I am writing 30 threads in 30 days about

https://abs.twimg.com/emoji/v2/... draggable="false" alt="🧵" title="collectie" aria-label="Emoji: collectie"> machine learning
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🧵" title="collectie" aria-label="Emoji: collectie"> data science
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🧵" title="collectie" aria-label="Emoji: collectie"> Python coding

Find them here: https://twitter.com/JesperDramsch/status/1479863422967767040">https://twitter.com/JesperDra...
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🏆" title="Trofee" aria-label="Emoji: Trofee"> Extra Credit

https://abs.twimg.com/emoji/v2/... draggable="false" alt="🦾" title="Mechanische arm" aria-label="Emoji: Mechanische arm"> Use nbconvert to run all cells from the command line

https://abs.twimg.com/emoji/v2/... draggable="false" alt="🧠" title="Hersenen" aria-label="Emoji: Hersenen"> Write a utils file with reusable functions

https://abs.twimg.com/emoji/v2/... draggable="false" alt="⌨" title="Toetsenbord" aria-label="Emoji: Toetsenbord"> Learn keyboard shortcuts for efficiency

https://abs.twimg.com/emoji/v2/... draggable="false" alt="🎨" title="Kunstenaarspalet" aria-label="Emoji: Kunstenaarspalet"> Make it interactive with ipykernel
TL;DR

https://abs.twimg.com/emoji/v2/... draggable="false" alt="👉" title="Rug van hand met naar rechts wijzende wijsvinger" aria-label="Emoji: Rug van hand met naar rechts wijzende wijsvinger"> Care about code quality
https://abs.twimg.com/emoji/v2/... draggable="false" alt="👉" title="Rug van hand met naar rechts wijzende wijsvinger" aria-label="Emoji: Rug van hand met naar rechts wijzende wijsvinger"> Use markdown cells (More than just headings)
https://abs.twimg.com/emoji/v2/... draggable="false" alt="👉" title="Rug van hand met naar rechts wijzende wijsvinger" aria-label="Emoji: Rug van hand met naar rechts wijzende wijsvinger"> Make sure the notebook runs
https://abs.twimg.com/emoji/v2/... draggable="false" alt="👉" title="Rug van hand met naar rechts wijzende wijsvinger" aria-label="Emoji: Rug van hand met naar rechts wijzende wijsvinger"> Use extra tools to make your life easier
You can follow @JesperDramsch.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: