Search
Find a bite, explore a topic or look for a role.
Results for “Python”
Bites 291
pandas DataFrame: A Spreadsheet in Code
Think of a pandas DataFrame as a powerful spreadsheet you control with code. It's the workhorse for loading, cleaning, and analyzing tabular data in Python, like sales figures from a CSV.

Email Spam: The Origin of Junk Mail
Email spam is any unsolicited message sent in bulk. Named after a Monty Python sketch for its intrusive nature, it grew to comprise 90% of all email by 2014, making spam filters a universal necessity.

Pulumi: Infrastructure as Code with Real Programming Languages
Pulumi is Infrastructure as Code using real languages like Python or TypeScript, not a special DSL. This lets you use loops, functions, and classes to define resources. The main footgun is writing overly complex, clever code that becomes unmaintainable.
Async SQLAlchemy 2.0: the mental model that clicks
SQLAlchemy's async layer bridges its synchronous ORM internals to asyncio. Use AsyncSession and AsyncEngine with an async driver, and await database work. Prerequisites: Python asyncio and basic SQLAlchemy ORM; lazy relationships must be loaded explicitly to avoid implicit I/O errors.
Mapping camelCase JSON to snake_case Pydantic fields
Set an alias_generator (to_camel) plus populate_by_name in model config, accept aliases on input, and serialize with by_alias=True so responses come out camelCase.
asyncio.gather vs asyncio.wait
Gather returns ordered results and propagates the first exception (or captures them); wait returns done/pending sets and never raises, you inspect each.
How FastAPI uses type hints for validation
Hints drive parsing, validation, and conversion; a path declared int is coerced or returns 422; OpenAPI is auto-generated.
OpenTelemetry API, SDK, and Collector
API defines vendor-neutral instrumentation, SDK implements and exports it, Collector receives, processes, and routes telemetry to backends.
Auto-Instrumentation
Auto-instrumentation automatically adds telemetry to an application without manual code changes, by hooking into libraries, frameworks, or the runtime. It gives broad baseline observability fast, but produces generic spans that often need manual…
Declarative vs imperative ML platform design
Declarative GitOps gives auditable, reproducible, reviewable desired-state config with strong governance but a steeper learning curve; imperative SDKs are flexible and fast for scientists but harder to…
Flask/Gunicorn vs Triton/TorchServe for serving
Flask is simple and flexible but lacks dynamic batching, GPU scheduling, and multi-model management; Triton/TorchServe add those plus metrics and versioning.
Hugging Face Hub, transformers, and datasets
The Hub hosts models and data, transformers loads models and tokenizers and provides the Trainer, datasets streams and maps preprocessing.
What is a container vs a VM?
Containers share the host kernel and isolate via namespaces and cgroups; VMs run a full guest OS on a hypervisor; containers are lighter and faster.
Diagnosing Spark executor OutOfMemoryError
Check the Spark UI for skew and spills, inspect executor memory and partition count, find culprits like wide collect, huge shuffles, or skewed keys, and fix via more partitions, memory tuning, or…
Spark RDDs, DataFrames, and Datasets
RDDs are low-level typed object collections with no built-in optimization; DataFrames are named columns optimized by Catalyst and Tungsten; Datasets add compile-time type safety in…
Pandas loc versus iloc indexing
Loc selects by label and is inclusive of both endpoints; iloc selects by integer position and is exclusive of the stop; passing a string label to iloc fails.
Writing a Dockerfile for a web app
FROM a base, set WORKDIR, install dependencies before app code for cache reuse, EXPOSE the port, CMD the start command.
Cold starts in serverless environments
A cold start is the delay to provision a fresh instance and initialize the runtime; mitigate with provisioned concurrency and by shrinking init work.
Deploying to Heroku via Git
Push to the remote, a buildpack detects the language, builds a slug, and runs the Procfile process.
The cloud shared responsibility model
The provider secures the cloud (hardware, OS, runtime), you secure what runs in it (code, data, config, access).