Skip to content

Notes on writing code

BEvanGelderen edited this page Feb 26, 2025 · 2 revisions

print statements

At the bottom of a code block, do not use print(x) but instead just write x as the last line to have it printed. This ipython magic uses the display function, which makes tables look nice.

Use f-strings!

See this explanation from Geeks for Geeks.

Plotting

Use Seaborn in addition to Matplotlib.
import seaborn as sns

Remove the outputs when committing a file

We need to test this out, but commits look a lot better when no images are included. We need to test if this is also best for publishing the book.

Clone this wiki locally