How to Fit a Curve to Power-law Distributed Data in Python

In this tutorial, you’ll learn how to generate synthetic data that follows a power-law distribution, plot its cumulative distribution function (CDF), and fit a power-law curve to this CDF using Python. This process is useful for analyzing datasets that follow power-law distributions, which are common in natural and social phenomena. Prerequisites Ensure you have Python … Read more

Visualizing Wealth: Plotting the Net Worth of the World’s Richest in Log/Log Space

The distribution of wealth, especially when it comes to the ultra-wealthy, is a subject of immense fascination and study. It can reveal patterns and insights into economic structures, inequality, and financial dynamics at the highest levels. One of the most revealing ways to examine this distribution is through a log/log plot of the net worths … Read more

The Art of Clean Code – Less Is More In Design

As developers, we rarely perceive ourselves as designers, yet interface crafting is an integral facet of our craft. Be it shaping an intuitive dashboard for data analysis, architecting an easily navigable API, or constructing straightforward web interfaces for blockchain applications, a grasp on basic design principles separates the forgettable from the functional. 💡 This chapter … Read more

50 Best Midjourney Style Prompts (New Version 6)

👉 Please find a comma-separated list of styles at the end of this article! On Twitter, you often read beginners voicing a strong and mostly unfounded opinion that prompt engineering is not a real skill. Yet – changing a single word in a 32-word prompt can completely change the output. Alien technology, indeed! And taming … Read more

Yahoo-Fin: Fetching Historical Stock Data with Python’s Yahoo Finance API

This guide provides an easy-to-understand foundation for beginners and intermediate users to leverage the Yahoo Finance API with Python for financial data analysis. Yahoo Finance API offers a wealth of financial data, from stock prices and market trends to currency exchange rates. This guide will introduce you to using the Yahoo Finance API yahoo_fin with … Read more

Matplotlib Colors: A Comprehensive Guide for Effective Visualization

Here’s a minimal example of using colors in Matplotlib. This example creates a simple line plot with a specified color: In this minimal code example, plt.plot(x, y, color=’red’) creates a line plot of x versus y, with the line color set to red. You can replace ‘red’ with other color names like ‘blue’, ‘green’, etc., … Read more

DALL·E 3 Trick: Using Seeds to Recreate the Same Image

Problem Formulation You may have encountered the following: When issuing the same prompt twice to ChatGPT with DALL·E 3, you’ll get different images even though the prompt is identical. How can I recreate the same image in a new Chat, either for myself or for somebody else to reproduce it? Here’s an example in a … Read more

Python Code for Getting Historical Weather Data

To get historical weather data in Python, install the Meteostat library using pip install meteostat or run !pip install meteostat with the exclamation mark prefix ! in a Jupyter Notebook. If you haven’t already, also install the Matplotlib library using pip install matplotlib. Then, copy the following code into your programming environment and change the … Read more

Want Exploding Bitcoin Prices North of $500,000 per BTC? “Grow N” Says Metcalfe’s Law

Metcalfe’s law states that the value of a network (V) is proportional to the square of the number of connected users of the system (N²). In this article, I’ll develop a Bitcoin price prediction (V) in the year 2030 based on the average growth rate of the number of Bitcoin nodes (N). General Intuition Metcalfe’s … Read more

Towards Reverse Engineering Matplotlib Code From Images

I tried a few helpful applications of Google Bards Image Recognition capabilities for coders. I don’t know about you but I often see beautiful plots (e.g., in research papers or data science reports) and wonder how I could recreate them. Well, Google Bard to the rescue! ✅ Reverse Engineer Exponential Plot in 2D First, let’s … Read more