Pages

Topics

Tools

↑↓navigate↵openescclose

Python guides

Every published Python guide, newest first, with practical examples you can copy into your own project.

3,965 guides across 14 topics

Topics

Latest Python guides

A clean technical illustration showing a NumPy array being filtered by a boolean mask and then selected by integer indices, with a highlighted np.where conditional branch.
Python

NumPy Boolean Indexing, Fancy Indexing, and np.where

Learn how to use NumPy boolean indexing, fancy indexing, and np.where to filter, select, and conditionally replace array elements, with practical examples and common pitfalls.

NumPyBoolean indexingFancy indexingnp.where
Diagram showing multiple arrays merging into one array and one array splitting into multiple parts, representing NumPy concatenate, stack, split, and append operations.
Python

NumPy Concatenate, Stack, Split, and Append

python numpy concatenate stack split and append: Learn how to combine and divide NumPy arrays with concatenate, stack, split, and append, and understand when each func...

NumPyArray ManipulationData SciencePython
Diagram showing NumPy array transformations: reshape, flatten, ravel, and transpose with view and copy labels.
Python

Python NumPy reshape, flatten, ravel, and transpose

Learn the differences between NumPy's reshape, flatten, ravel, and transpose, including when each returns a view versus a copy and how memory layout affects performance.

NumPyarray manipulationreshapeflatten
A 3D grid of blocks representing a NumPy array, with a highlighted slice cut through the grid to illustrate indexing and slicing.
Python

Python NumPy Array Creation, Indexing, and Slicing

Learn how to create NumPy arrays, use indexing and slicing, and understand when operations return views instead of copies.

NumPyArray CreationIndexingSlicing
Comparison of three Python web scraping tools: Scrapy, BeautifulSoup, and Selenium, with a spider, a soup bowl, and a browser window.
Python

Python Scrapy vs BeautifulSoup vs Selenium

Compare Scrapy, BeautifulSoup, and Selenium for Python web scraping. Learn which tool fits static pages, dynamic content, and large-scale crawling.

web scrapingScrapyBeautifulSoupSelenium
Illustration of a Scrapy spider exporting scraped data into CSV and JSON file formats.
Python

Python Scrapy Export to CSV and JSON

Export Scrapy scraped data to CSV and JSON with feed exports. Learn field ordering, custom JSON serializers, JSON Lines vs array output, overwrite behavior, and debugging tips.

ScrapyWeb ScrapingCSV ExportJSON Export
Illustration of a Scrapy crawler balancing retries, concurrency limits, and throttling delay against a target server.
Python

Python Scrapy Retries, Concurrency, and Throttling Settings

python scrapy retries concurrency and throttling: Configure Scrapy retries, concurrency limits, and AutoThrottle so your crawler stays fast without hammering the targe...

scrapyweb-scrapingretriesautothrottle
Illustration of Scrapy middleware intercepting requests to manage cookies, proxy, and user agent.
Python

Python Scrapy Middleware for Cookies, Proxy, and User Agent

python scrapy middleware cookies proxy and user agent: Learn how to build Scrapy middleware to manage cookies, rotate user agents, and route requests through proxies,...

ScrapyMiddlewareWeb ScrapingProxy Rotation
Illustration of scraped data items flowing through a series of processing stages represented as connected pipeline nodes.
Python

Python Scrapy Items, Pipelines, and Data Processing

Learn how Scrapy item classes structure scraped data and how item pipelines validate, clean, deduplicate, and persist it before storage.

ScrapyWeb ScrapingData ProcessingItem Pipelines
Illustration of a Scrapy spider crawling through multiple paginated pages of a website.
Python

Python Scrapy Pagination and Multi-Page Crawling

Learn how to implement pagination in Python Scrapy to crawl multiple pages efficiently. Covers CrawlSpider rules, manual request loops, offset-based URLs, rate limiting, and error handling.

ScrapyWeb CrawlingPaginationCrawlSpider