Skip to content
Python Lore

Python Lore

The ultimate Python guide

  • Home
  • Home
Understanding Principal Component Analysis with scikit-learn
Posted inPython modules scikit-learn

Understanding Principal Component Analysis with scikit-learn

Posted inPython modules, scikit-learnTags: Principal Component Analysis, scikit-learn
Matrix multiplication for PCA transformation, projecting centered data onto principal axes. Visualize transformed data with scatter plots using Matplotlib.
Read More
Customizing asyncio Event Loop Implementations
Posted inasyncio Python modules

Customizing asyncio Event Loop Implementations

Posted inasyncio, Python modulesTags: Customizing, Event Loop Implementations
Python asyncio event loop internals. How the loop handles non-blocking I/O, scheduled callbacks, Tasks, and Futures using a ready queue, min-heap, and selectors.
Read More
Data Loading and Processing using torch.utils.data
Posted inPython modules PyTorch

Data Loading and Processing using torch.utils.data

Posted inPython modules, PyTorchTags: Data Loading, torch.utils.data
PyTorch DataLoader custom collate_fn for variable size data. Handle variable length sequences, tensors with different shapes, and avoid RuntimeException by padding batches.
Read More
Managing HTTP Redirects with http.client.HTTPRedirectHandler
Posted inhttp Python modules

Managing HTTP Redirects with http.client.HTTPRedirectHandler

Posted inhttp, Python modulesTags: http.client.HTTPRedirectHandler, Redirect Management
HTTP 301, 302, 307, 308 redirects for POST requests. Preserving the request method vs changing to GET. Python urllib.request.HTTPRedirectHandler example.
Read More
Exploring TensorFlow Datasets for Data Loading
Posted inPython modules TensorFlow

Exploring TensorFlow Datasets for Data Loading

Posted inPython modules, TensorFlowTags: Data Loading, TensorFlow Datasets
TensorFlow custom data pipelines with `tf.data`. Use `from_tensor_slices` for arrays or `from_generator` with `output_signature` for large, scalable datasets.
Read More
Using json.detect_encoding for Encoding Detection
Posted injson Python modules

Using json.detect_encoding for Encoding Detection

Posted injson, Python modulesTags: Encoding, json.detect_encoding
Heuristic character encoding detection for BOM-less data using Python's charset-normalizer. A tiered strategy vs. json.detect_encoding for handling non-UTF-8 data.
Read More
Spatial Data Structures and Algorithms with scipy.spatial
Posted inPython modules SciPy

Spatial Data Structures and Algorithms with scipy.spatial

Posted inPython modules, SciPyTags: scipy.spatial, Spatial Data
K-d tree for efficient range search and query ball problems. SciPy's `query_ball_point` finds all points within a radius, outperforming brute-force O(n²) loops.
Read More
Sorting Data with pandas.DataFrame.sort_values
Posted inPandas Python modules

Sorting Data with pandas.DataFrame.sort_values

Posted inPandas, Python modulesTags: Data Sorting, pandas.DataFrame.sort_values
Pandas sort_values performance guide. Compare quicksort, mergesort, heapsort. Stable vs unstable sort. O(n log n) complexity, data types, memory impact.
Read More
Image Histograms and Statistics with Pillow
Posted inPillow (PIL Fork) Python modules

Image Histograms and Statistics with Pillow

Posted inPillow (PIL Fork), Python modulesTags: Histograms, Statistics
Python Pillow contrast correction for low contrast photos. Contrast stretching with ImageOps.autocontrast & histogram equalization with ImageOps.equalize.
Read More
Serving JSON Data with Flask
Posted inFlask Python modules

Serving JSON Data with Flask

Posted inFlask, Python modulesTags: Flask, Serving JSON
Flask API error handling for JSON. Custom JSON error responses for 404 and 500 status codes using @app.errorhandler instead of Flask's default HTML pages.
Read More

Posts pagination

1 2 3 … 45 Next page
Books
Python Programming for Beginners
Posted inBooks
Python Programming for Beginners
Murach's Python Programming
Posted inBooks
Murach’s Python Programming
Python Mastery
Posted inBooks
Python Mastery
Python for Beginners
Posted inBooks
Python for Beginners
Copyright 2023-2025 by Python Lore. All rights reserved.
Scroll to Top