~/talk

Decorators for Data Science

Talkat PyCon Israel 2017 · 2017-06-11..06-13· [data-science, python]
name:Uri Goren
links:none on file
slides:none on file

Uses decorators inside Jupyter to solve real problems: LRU cache cuts a naive recursive Fibonacci at n=30 by over 400×, and memoizing a recursive Levenshtein on 10 words (100 pair runs) drops runtime from ~40,000 ms to ~10 ms. Implements JSON-on-disk caching that names files from bound arguments using inspect.signature, an SSH wrapper (paramiko-style) that runs commands remotely and returns remote cwd, and a record/replay decorator for regression tests plus ipywidgets interact for live Gaussian plots.

AI-written summary · about

  1. 0:00Introduction to decorators
  2. 1:27What are decorators in Python
  3. 4:24Memoization with LRU cache
  4. 8:24Disk caching with JSON decorator
  5. 10:11Handling function arguments with inspect
  6. 12:45SSH decorator for remote commands
  7. 14:56Regression testing with decorators
  8. 16:25Interactive graphs in Jupyter
  9. 18:34Q&A and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.