Skip to content
Pythoneo: Python Programming, Seaborn & Plotly Tutorials

Master Python: How-To Tutorials & Solutions for Coders

  • Home
  • Privacy Policy
  • About
  • Cookie Policy
  • Home
  • Privacy Policy
  • About
  • Cookie Policy
  • Django

    How to squash migrations in Django

    February 15, 2023

    To squash migrations in Django, you can use the squashmigrations management command. This command combines multiple migration files into a single file, making your database schema more concise and reducing the size of your migration history.

    Continue Reading
  • Django

    How to add to manytomany field in Django

    February 15, 2023

    Adding to a ManyToMany field in Django is quite straightforward and offers a few different ways to achieve it, depending on your needs. The key is that ManyToMany relationships don’t directly store the related objects on the “many” side; instead, they manage an intermediate table.

    Continue Reading
  • numpy

    Swap Numpy row vector to column vector

    February 13, 2023

    How to convert row vector to column vector in NumPy: reshape(-1, 1) vs transpose() methods with examples.

    Continue Reading
  • Plotly

    How to add vertical line in Plotly

    February 13, 2023

    In Plotly, you can add a vertical line to a plot by using the “shape” attribute in the layout. Here’s a simple example in Python:

    Continue Reading
  • numpy

    How to calculate exponential of complex number in Numpy?

    February 13, 2023

    In NumPy, you can calculate the exponential of a complex number using numpy.exp. The exponential of a complex number z can be represented as exp(z) = exp(x) * (cos(y) + 1j * sin(y)), where x is the real part and y is the imaginary part of your complex number.

    Continue Reading
  • bokeh

    How to use curdoc in Bokeh

    January 31, 2023

    curdoc() is a function in Bokeh that returns the current document for a Bokeh application. You can use curdoc() to access the current document and add, remove, or modify elements in it.

    Continue Reading
  • Pillow

    How to Build Custom Image Processing Filters with Advanced Algorithms

    January 13, 2023

    Extending Pillow‘s ImageFilter module with custom filters unlocks powerful image processing capabilities—ranging from edge detection to color grading via 3D lookup tables. This guide covers building convolution kernels, 3D LUT transforms, and integrating NumPy for per-pixel operations, with performance tips like Pillow-SIMD and multi-threading.

    Continue Reading
  • Django

    How to optimize django database queries

    December 21, 2022

    Efficient database access is critical for Django applications at scale. This guide shows you how to identify and eliminate common performance pitfalls—such as the N+1 query problem—and apply advanced ORM features, indexing, and caching strategies to dramatically reduce query counts and latency.

    Continue Reading
  • Python

    How to solve TypeError: ‘set’ object is not subscriptable

    December 4, 2022

    This is the article where I’ll show you how to solve TypeError: ‘set’ object is not subscriptable in Python.

    Continue Reading
  • Python

    Resolving TypeError: Navigating Unsupported Operand Types for +

    November 15, 2022

    Encountering a TypeError: unsupported operand type(s) for + in Python is a common issue, especially for beginners. This error occurs when you attempt to use the addition operator (+) with data types that are not compatible for addition. This tutorial will explain the common scenarios that cause this error and provide clear solutions.

    Continue Reading
  • Python

    Introduction to XGBoost in Python

    November 10, 2022

    XGBoost is an efficient and widely used machine learning library that is an implementation of gradient boosting. It’s known for its speed and performance, especially in competition scenarios. Here’s how you can get started with XGBoost in your Python environment.

    Continue Reading
  • Python

    Working with Time Zones in Python Using Zoneinfo

    November 8, 2022

    Python’s zoneinfo module, introduced in Python 3.9, offers a robust solution for dealing with time zones. It provides access to the IANA time zone database, which is the industry standard for time zone information. Here’s how you can use the zoneinfo module in your Python applications.

    Continue Reading
  • numpy - Scipy

    How to Calculate the Factorial of an Array in Numpy

    November 4, 2022

    You will learn how to calculate the factorial of an array in Numpy.

    Continue Reading
  • Django

    How to Build Custom Security Middleware

    October 16, 2022

    Custom security middleware in Django allows you to enforce application-wide policies such as authentication, rate limiting, CSRF enhancements, and audit logging at the HTTP layer. This guide covers design patterns, implementation, and configuration for robust security middleware.

    Continue Reading
  • Django

    How to Implement JWT Authentication with Custom Middleware Security

    October 6, 2022

    JSON Web Tokens (JWT) provide stateless, secure authentication for REST APIs. Combining JWT with custom middleware enables advanced security patterns—such as request validation, rate limiting, and role-based access control—at the middleware layer. This guide uses Django REST Framework (DRF) and djangorestframework-simplejwt to implement robust JWT authentication and middleware-based security.

    Continue Reading
 Older Posts
Newer Posts 

Resources

  • Matplotlib Master Hub + Recipes
  • OpenCV Master Hub + Recipes
  • Seaborn Master Hub + Recipes
  • Tkinter Master Hub + Patterns
  • SciPy Optimize Cookbook (minimize, least_squares, linprog)
  • Plotly Maps & Geo Cookbook
  • Paramiko Master Hub + Production Cookbook
  • NumPy Master Hub + Cheatsheets
  • Ultimate Python Cheatsheet + Gotchas
  • Django Master Hub + Recipes

Tags

array axis button calculations chart column conversion count data type dimension draw dtype empty error fill float generate grid GUI image index integer list matrix max mean min mode multiply normal distribution number pie plot random reshape rotate round rows size string sum test text time zero

Categories

  • bokeh (6)
  • Django (13)
  • FastAPI (3)
  • matplotlib (13)
  • numpy (121)
  • OpenCV (7)
  • Pandas (6)
  • paramiko (63)
  • Pillow (6)
  • Plotly (23)
  • Python (75)
  • Scipy (9)
  • Seaborn (25)
  • statistics (6)
  • Tkinter (34)
  • turtle (2)

RSS RSS

  • Python for IoT and Edge Computing: Real-Time Analytics, Microcontrollers, and Local ML Inference
  • Integrating Large Language Models in Python: From API Calls to Production Deployment
  • Testing FastAPI Applications: Complete Guide with Pytest, Coverage, and Best Practices
  • Deploying Python Applications to Production: Docker, CI/CD, Monitoring and Scaling
  • FastAPI Authentication & Authorization: JWT, OAuth2, and RBAC
  • FastAPI Complete Guide: Building Production APIs
  • Plotly Scatter Plot Tutorial: Interactive Data Exploration
  • Python Data Visualization Best Practices: Creating Effective Charts
  • Matplotlib vs Seaborn: Which Library Should You Use?
  • Seaborn Pair Plots: Multivariate Relationship Visualization
Graceful Theme by Optima Themes