Fibonacci Series in Python: For Loop, While Loop and Recursion

Python Fibonacci series: the Command Prompt showing how many calls plain recursion makes

The shortest Fibonacci series program in Python is three lines, and it works because Python evaluates the whole right-hand side before assigning: That single swap line replaces the temporary variable other languages need. Everything else on this page is a variation on it. All the timings below are real runs on Python 3.12.5. What is … Read more >>

NumPy Empty Array: np.empty(), Zero-Length Arrays and dtype

NumPy empty array: the Command Prompt showing np.empty returning uninitialised leftover values

A NumPy empty array comes from np.empty(), which reserves memory without clearing it first: Those are two separate ideas that share a name. np.empty(5) has five slots full of junk, while np.array([]) genuinely holds nothing. Timings and output below come from Python 3.12.5, NumPy 2.5.3 on this machine. What np.empty actually returns The values are … Read more >>

Matplotlib Not Showing Plot: Fix It in VS Code, Jupyter or a Script

Matplotlib not showing plot: the Command Prompt warning that FigureCanvasAgg is non-interactive

When Matplotlib is not showing a plot, there are only three real causes, and two lines of code tell you which one you have: The screenshots on this page are real Command Prompt sessions on Python 3.12.5, Matplotlib 3.11.2. Check your Matplotlib backend first Don’t change any code until you know which backend is loaded. … Read more >>

Matplotlib Inline in Python

%matplotlib inline

When I first started working with Python for data visualization, I often wondered about the term Matplotlib inline. It’s a phrase that pops up frequently, especially when working with Jupyter notebooks. But what does it mean? And how can you use it effectively? In this article, I’ll share my firsthand experience with Matplotlib inline, explain … Read more >>

Build a React Text Editor Component 

React Text Editor Component 

A few months ago, I was working on a React project for a client in New York who needed a custom text editor for internal documentation. They wanted something that felt like Google Docs, clean, fast, and with formatting options like bold, italic, and bullet lists. At first glance, it seemed like a simple task. … Read more >>

Change Inner and Outer Background Colors in Matplotlib

Change Inner and Outer Background Colors Matplotlib

As a Python developer, working on a Python data visualization project for a U.S.-based retail analytics dashboard, I needed to make my Matplotlib charts more visually appealing. The problem was simple: the default white background wasn’t blending well with the dark-themed dashboard. So, I decided to change both the inner background color (the plot area) … Read more >>

Create Scatter Plot with Error Bars in Python Matplotlib

Create Scatter Plot with Error Bars Python Matplotlib

When I first started using Python for data visualization, one of the most common challenges I faced was representing uncertainty in data. I often had datasets where each point had a margin of error, and that’s when I discovered how powerful error bars in Matplotlib scatter plots can be. Over the years, I’ve used scatter … Read more >>

How to Plot Asymmetric Error Bars in Matplotlib

Plot Asymmetric Error Bars in Matplotlib

While working on a data visualization project for one of my clients in the USA, I needed to show measurement uncertainty that wasn’t the same above and below each data point. That’s when I realized I needed asymmetric error bars in my Matplotlib chart. If you’ve ever used Matplotlib in Python, you probably know it’s … Read more >>

Create a React Loading Spinner Component 

Create React Loading Spinner Component

While working on a React project for a U.S.-based client, I needed to display a loading spinner whenever data was being fetched from an API. I quickly realized that even though React makes UI rendering simple, handling loading states with a smooth spinner requires a bit of setup. So, I decided to create a reusable … Read more >>

How to Get URL Parameters Using jQuery?

Get URL Parameters Using jQuery

Getting URL parameters is a fundamental skill every web developer needs. Whether you’re building dynamic web applications or need to pass data between pages, extracting query parameters from URLs is essential. This comprehensive guide will show you multiple methods to get URL parameters using jQuery and plain JavaScript. What Are URL Parameters? URL parameters (also … Read more >>