10 Practical Python Code Examples for Common Development Tasks
1. Web Scraping with Requests and BeautifulSoup
To extract data from a website, such as headlines or metadata, you can utilize the requests library for HTTP requests and BeautifulSoup for parsing the HTML structure.
import requests
from bs4 import BeautifulSoup
target_url = 'https://www.example.com'
try:
response = requests.get(target_url) ...
Posted on Sat, 08 Aug 2026 16:10:46 +0000 by tippy_102
Creating Bar Charts with Scatter Points, Error Bars, and Statistical Significance Testing in Python and R
Introduction: Why Combine Bar Charts with Scatter Plots, Error Bars, and Statistical Tests
When visualizing comparative experimental data, simple bar charts showing means or medians often oversimplify the underlying data distributino. This article explains how to enhance bar charts with additional statistical elements to provide more comprehens ...
Posted on Wed, 05 Aug 2026 17:04:26 +0000 by point86
Two Approaches for Plotting Loss Curves in Caffe
Introduction
When training deep learning models with Caffe, visualizing the training progress through loss curves is essential for monitoring model convergence. This article presents two practical approaches for generating training visualizations.
Method 1: Custom Python Script for Headless Servers
The following implementation is specifically d ...
Posted on Fri, 31 Jul 2026 16:19:59 +0000 by goldilok
Data Visualization and Report Generation with Python
In today's data-driven world, data visualization and report generation are essential tools for data scientists, analysts, and business decision-makers. Python, with its powerful and flexible nature, offers extensive support through various libraries and frameworks for these tasks. This article delves into how Python can be used for data visuali ...
Posted on Tue, 28 Jul 2026 17:18:20 +0000 by killerofet
Three Essential Steps for Python Data Visualization
Three Fundamental Steps in Python Visualization
Data visualziation in Python typically follows three key stages:
Determine the problem and choose the right plot type
Prepare and transform data
Customize parameters for clarity
Commonly Used Visualization Libraries
Matplotlib: The foundational plotting library in Python, ideal for basic visual ...
Posted on Fri, 24 Jul 2026 16:20:57 +0000 by robinjohn
Sales Forecasting Using Linear Regression
Predict sales for November and December 2018.
import glob
import os
import pandas as pd
import re
import numpy as np
import datetime as dt
from sklearn.linear_model import LinearRegression
import seaborn as sns
from matplotlib import pyplot as plt
# Set font for Chinese characters
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axe ...
Posted on Fri, 10 Jul 2026 16:43:59 +0000 by Elhombrebala
Creating a Fireworks Display in Python with Multiple AI Models
The idea began after watching a fireworks simulation video on Bilibili, allegedly generated by a Python script. The uploader required viewers to follow, like, and comment before sending a private message to receive the source code. After jumping through several hoops—inlcuding forum registration and virtual currency purchases—the promised code ...
Posted on Thu, 09 Jul 2026 17:15:44 +0000 by sweetmaster
Customizing Line Styles and Markers in Python Plots
Marker Types
# Available marker symbols for data points
marker_symbols = {
'.': 'point',
',': 'pixel',
'o': 'circle',
'v': 'triangle_down',
'^': 'triangle_up',
'<': 'triangle_left',
'>': 'triangle_right',
'1': 'tri_down',
'2': 'tri_up',
'3': 'tri_left',
'4': 'tri_right',
's': 'square',
...
Posted on Wed, 08 Jul 2026 17:19:01 +0000 by Snart
Configuring and Customizing Matplotlib Colorbars in Python
A colorbar serves as a visual legend for scalar mappable objects in Matplotlib, translating color gradients into quantitative values. Configuring it properly is essential for accurate data interpretation in heatmaps, contour plots, and surface visualizations.
Instantiating a Basic Colorbar
The standard approach involves passing the mappablle ar ...
Posted on Mon, 06 Jul 2026 17:43:10 +0000 by Daisatske
Python Knowledge Summary
Important Links
matplotlib: matplotlib — Matplotlib 3.5.1 documentation
seaborn: seaborn.lineplot — seaborn 0.13.2 documentation
DataFrame: DataFrame — pandas 2.2.1 documentation
Python Matplotlib Scatter, Line, Box, Bar Plot Examples: Python Matplotlib 实现散点图、曲线图、箱状图、柱状图示例
Color Palettes: matplotlib、seaborn颜色、调色板、调 ...
Posted on Wed, 01 Jul 2026 16:38:09 +0000 by himnbandit