Skip to content
tezvyn:

Search

Find a bite, explore a topic or look for a role.

Results for Python

Bites 291

Data Science & Analytics2 min read

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
Content & Copywriting2 min read

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
CI/CD & Automation2 min read

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
Python & FastAPI2 min read

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.

Python & FastAPI1 min read

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.

Python & FastAPI1 min read

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.

Python & FastAPI1 min read

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.

Monitoring & SRE2 min read

OpenTelemetry API, SDK, and Collector

API defines vendor-neutral instrumentation, SDK implements and exports it, Collector receives, processes, and routes telemetry to backends.

Monitoring & SRE1 min read

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…

MLOps & Infrastructure2 min read

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…

MLOps & Infrastructure1 min read

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.

LLMs & Generative AI1 min read

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.

Docker & Kubernetes1 min read

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.

Data Science & Analytics2 min read

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…

Data Science & Analytics1 min read

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…

Data Science & Analytics1 min read

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.

Cloud Platforms1 min read

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.

Cloud Platforms2 min read

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.

Cloud Platforms1 min read

Deploying to Heroku via Git

Push to the remote, a buildpack detects the language, builds a slug, and runs the Procfile process.

Cloud Platforms1 min read

The cloud shared responsibility model

The provider secures the cloud (hardware, OS, runtime), you secure what runs in it (code, data, config, access).