Tag: Python
All the articles with the tag "Python".
-
Selecting, dropping and inserting rows in a pandas DataFrame
· UpdatedFilter pandas rows with boolean masks and str.startswith, drop rows by value, reset the index, and add rows with loc or concat now that append() is gone.
-
Retries in Python: from a basic retry loop to exponential backoff for API rate limits
· UpdatedRetry in Python from a basic try/except loop to production: Retry-After, exponential backoff with full jitter, idempotency, urllib3 Retry and tenacity.
-
Selenium vs Beautiful Soup: when to use each, and how to combine them
· UpdatedSelenium drives a browser for JavaScript pages and form clicks; Beautiful Soup parses HTML you already fetched. Selenium 4 examples and a combined workflow.
-
Tracking S3 file changes with ETags and LastModified
· UpdatedDetect changed S3 objects without versioning: read ETag and LastModified with boto3, export an ETag CSV per date prefix, and handle multipart ETags.
-
Working with JSON in Python and pandas: json.load, JSON Lines and read_json
· UpdatedRead and write JSON with Python's json module, clean malformed files, and load JSON arrays or JSON Lines exports into pandas with read_json(lines=True).
-
Batch API Requests in Python: Throughput vs Rate Limit Trade-Off
Push more records through a rate-limited API in Python: concurrency sizing with Little's Law, batch size trade-offs, and an asyncio token bucket with httpx.
-
How to Get the Status of an AWS Glue Workflow Using boto3
A Glue workflow can report COMPLETED while its jobs failed. How to poll workflow runs with boto3 and read per-node status from the run graph.
-
AWS Glue Job Fails Due to Dependency Version Conflict: How to Fix It
Your Glue job works locally but fails with ImportError or numpy binary incompatibility. Why it happens and how to pin dependencies against the Glue runtime.