Beautiful Python Refactoring
summary
A concrete refactor pipeline takes scraped HTML rows using requests and lxml into a list comprehension and finally into a pandas DataFrame reducing code from 60+ lines to ~10 and then to three to five lines by using pandas.read_html. The code builds a working scraper and an analysis that shows C++ dominates submissions C++ 89% Python 6% Java 4%. Notes mention cuDF as a drop-in acceleration with reported ~100x speedups.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:14Why this talk
- 3:09How I started
- 5:50Imports
- 11:30Data Extraction
- 11:45If Statement
- 12:23Slicing
- 14:57Conditional Expressions
- 17:11Structural Changes
- 23:39Step 2 HTML Table
- 24:46Step 3 Code
- 26:46Performance
- 28:16Python Bites
related talks
01h 33mFrom Raw Recruit Scripts to Perfect Python
30mSpeed Up Your Data Processing
25mPandas on Jupyter: Improving Your Data Analysis Workflow
01h 55mAll Them Data Engines: Data Munging with Python circa 2023
31mTechnical Lessons Learned from Pythonic Refactoring
53mPython strategy panel
19mPython - best practices
40mHow To (Semi-)Automate JavaScript Refactoring
