包含标签 python 的文章

Using Matplotlib's fill_between for Area Filling in Python

When plotting with matplotlib in Python, sometimes to enhance the aesthetics of the graph, it’s necessary to fill with color above or below the plot. The ‘fill_between’ function is used for this, where the ‘y2’ parameter determines the second line, indicating whether to fill upwards or downwards.……

阅读全文

Python: Creating Beautiful Lollipop Charts

The lollipop chart, as a variant of bar charts and dot plots, is increasingly popular in scientific research due to its simplicity and clarity. This chart cleverly combines the advantages of bar charts and scatter plots, offering a visually more attractive way to represent data.……

阅读全文

Downloading m3u8 Streaming Media Using Python and Embedding into AMP Webpages

In the era of short videos and live streaming, video formats are often no longer traditional ones like mp4 or mkv, but streaming formats such as m3u8. If you want to download your favorite videos, special handling is needed. This article provides a detailed example of how to download m3u8 streaming data using Python and embed it into an AMP webpage for playback. Let’s dive into the full process.……

阅读全文

Drawing Raincloud Plots with Python

When performing exploratory analysis, bar charts and box plots are excellent methods that can effectively display the general data structure and distribution. Recently, I saw someone using raincloud plots to display data, and the graphics looked beautiful and interesting. Therefore, I have organized this information and implemented the drawing of raincloud plots using Python.……

阅读全文

Python Native Lists vs. NumPy Arrays

In Python, you can choose from various native data types to store collection data, including list, array, tuple, and dictionary. Among these, the list is highly flexible, can store any content, and is mutable, making it widely applicable. However, for scientific computing and storing purely numerical data, NumPy is widely used and has practically replaced lists. So, what are the differences between them, how significant are these differences, and how should they be applied in practice?……

阅读全文

Hands-on Implementation of Random Forest Algorithm with Python

This article will guide you through a hands-on implementation of a powerful random forest machine learning model. It aims to complement my conceptual explanation of random forests, but as long as you have a basic understanding of decision trees and random forests, you can fully read it. Later, we will discuss how to improve the model built here.……

阅读全文

Calculating the Gini Coefficient and Plotting the Lorenz Curve with matplotlib

The Gini coefficient and Lorenz curve are widely used to represent data inequality, especially wealth inequality. However, currently in Python, there isn’t a very good function to directly plot the Lorenz curve. Since the current project requires it, this article records how to use numpy, pandas, matplotlib, and other packages to calculate the Gini coefficient and plot the Lorenz curve for practical use.……

阅读全文