Skip to content

Instantly share code, notes, and snippets.

@nbroad1881
Created April 30, 2020 10:58
Show Gist options
  • Save nbroad1881/2272782e936946a4a016880b4d5ed364 to your computer and use it in GitHub Desktop.
Save nbroad1881/2272782e936946a4a016880b4d5ed364 to your computer and use it in GitHub Desktop.
Python magic snippets
# help for a function
%timeit?
# run code block multiple times to get average time
%%timeit
L = [n ** 2 for n in range(1000)]
# paste multi-line code to cell
%paste
>>> def donothing(x):
... return x
# documentation
%magic
# list of functions
%lsmagic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment