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.……
This guide shows how to mount Oracle Object Storage on Linux with s3fs-fuse, including namespace and region lookup, credential setup, the mount command, and a simple post-mount verification step.……
In Python, to check whether an array or tuple is empty, there are three methods: comparing with an empty list, checking the length, and using an if statement.……
I just saw a post on the forum about Okteto’s free containers, and since I hadn’t registered before, I decided to deploy my site’s Flask app using Okteto’s free container. Okteto’s free Kubernetes plan offers generous resources: 4-core CPU, 8GB RAM, 10GB SSD — basically a great VPS for free. Here’s how to deploy using Okteto.……
This article explains the confusion matrix in machine learning classification, clarifies TP, TN, FP, and FN, and shows how to calculate precision, recall, accuracy, and F1.……
I’ve been using LEDE OpenWRT firmware as my router’s firmware. Due to version updates, some software is missing in older versions, so I decided to compile a custom firmware containing only the needed software for my Phicomm K2 router.……
Since the original domain registered on freenom expired and could no longer be used, I chose to go back to freenom to register a new domain for fun, but found that due to technical issues, the registration kept failing, and the domains below would be canceled.……
Since the original logo has a white background, and we need to change the white background to transparent, here we use the versatile Python tool for image conversion, specifically the pillow package’s Image.……
This tutorial uses a simple quadratic function to explain the core idea of gradient descent, including the gradient direction, learning rate, stopping condition, and a step-by-step Python implementation.……