When visualizing data, it’s common to plot multiple charts in a single figure. For example, visualizing the same variable from different perspectives like side-by-side histograms and boxplots for numerical variables is useful.……
阅读全文
When using scrapy to crawl web pages, many websites render content with JavaScript, so directly fetching the source code will not get the needed content. In this case, using selenium to drive a browser to get the rendered content is very suitable.……
阅读全文
Since the default addresses for pip and anaconda are very slow to access in China, adding domestic mirrors for acceleration is necessary.……
阅读全文
This tutorial shows how to build a random forest regression workflow with Python and sklearn using Shanghai weather data, covering setup, cleaning, feature engineering, training, evaluation, and prediction.……
阅读全文
This article summarizes the 6 most useful Python string splitting methods, including split, rsplit, splitlines, partition, rpartition, and re.split, with practical examples and usage notes.……
阅读全文
This article shows how to inspect Aliyun’s domain-reserve requests with Python and automatically collect candidate lists of recently expired .com domains for later manual review and registration.……
阅读全文
This guide explains how to solve LeetCode 468 in Python by combining the ipaddress module with the stricter problem-specific rules for IPv4 and IPv6.……
阅读全文
In Venn diagrams of two sets, there can be two (or more) overlapping circles representing sets of different sizes, but the circles are the same size. Actually, the circles should be proportional to the size of the sets, and the overlapping area should also be proportional to the data overlap.……
阅读全文
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.……
阅读全文
Bayesian theory provides a principled method for calculating conditional probabilities. With it, we can easily compute conditional probabilities for events where intuition often fails.……
阅读全文
Historical stock data is a very important kind of time series data, playing a significant role in data science. Let’s start learning how to handle time series data, preparing for future stock prediction and analysis.……
阅读全文
This guide shows how to use Python folium to build a global choropleth map from public COVID-19 data, including WHO data loading, country-code mapping, and log-based styling for better readability.……
阅读全文