I wish I learnt that earlier!
summary
Covers concrete Python idioms and measured tradeoffs: list comprehensions beat a loop (1.41 ms vs 2.08 ms) and use less memory, but csv.reader can be slower than manual parsing while pandas is faster for big files; saving random.random locally or using from random import random speeds calls (local ~1.31 ms vs 888 ns). Shows generators (including an infinite prime generator), that functions are objects you can pass, round-to-even behavior for round( .5 ), and collections: namedtuple, deque, Counter, defaultdict. Also PEPs, docstrings and Jupyter usage.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 1:54List comprehensions
- 5:14Python language features
- 15:07Collection classes
- 21:01Development practices
- 23:56Q&A and conclusion
related talks
19mPython - best practices
43mWhy do I need to know Python- I'm a pandas user
52mPython Tips, Tricks, and Idioms
41mMore About Generators
42mIntuition vs. Reality: Surprising Truths in Python Performance
01h 12mFurious & Fast Python 7: Writing Fast Python Code
30mWrite faster Python! Common performance anti patterns
57mPython's other collection types and algorithms
