(Fixed) TypeError: FigureBase.gca() got an unexpected keyword argument ‘projection’

When trying to plot a 3D normal distribution recently, I encountered the following error: TypeError Traceback (most recent call last) <ipython-input-10-ee1b0cd4b744> in <cell line: 32>() 30 fig = plt.figure() 31 —> 32 ax = fig.gca(projection=’3d’) 33 34 # create a 3D surface plot of the multivariate normal distribution πŸ‘‰ TypeError: FigureBase.gca() got an unexpected keyword … Read more

How Do I Make a 3D Waterfall Plot with Colored Heights in Python?

To generate a 3D waterfall plot with colored heights create a 2D sine wave using the NumPy meshgrid() function, then apply a colormap to the heights using Matplotlib’s Normalize function. The plot_surface() function generates the 3D plot, while the color gradient is added using a ScalarMappable object. Here’s a code example for copy and paste: … Read more

GPT-4 Code Interpreter – How to Run Python & Plot Data in ChatGPT

GPT-4 now provides a friendly little tool that has the potential to completely change the coding industry. Again. You can activate the code interpreter in your ChatGPT Settings: Toggle the “Code Interpreter” option (currently in “Beta features” but not for long): Now you can run the code interpreter using a simple natural language prompt such … Read more

How to Embed A Live Stock Chart in Your WordPress Blog Given a Ticker

I was just working on a website for financial data analysis and wanted to embed a real demo live trading chart on the company that was being analyzed (YUMM – don’t research it – not worth it). πŸ˜‚ This article shares my experience with TradingView. Embedding a live stock chart on your website or blog … Read more

How I Cracked the Top 100 in the Kaggle House Prices Competition

Kaggle is a vibrant online community for data science and machine learning, providing a platform for learning, sharing, and competition. It’s an invaluable resource for individuals interested in these fields, regardless of their level of experience. The Kaggle House Prices – Advanced Regression Techniques Competition, in particular, is an excellent starting point for anyone who … Read more

Python 🐍 Put Legend Outside Plot πŸ“ˆ – Easy Guide

Are you tired of feeling boxed in by your Python plots and ready to break free from the constraints of traditional legend placement? In this guide, I’ll show you how to put legends outside your plot for (click to 🦘 jump): Let’s start with the first! πŸ‘‡πŸ‘©β€πŸ’» Matplotlib Put Legend Outside Plot Let’s start with … Read more

How I Scattered My Fat with Python – Scraping and Analyzing My Nutrition Data From Cronometer.com

From April 1st through August 14th, I tracked everything I ate on cronometer.com as part of a weight loss challenge. Overall I lost almost 25 pounds at a rate of 1.2 pounds per week. I always wondered what I could learn if I could scrape that data and get it into a Jupyter Notebook. In … Read more

5 Easy Ways to Download an Image from a URL in Python

Problem Formulation and Solution Overview In this article, you’ll learn how to download an image from the web in Python. To make it more fun, we have the following running scenario: Sven, a Journalist from Greeland, is writing about Glacier Calving. His editor would like photos of iceberg collapses in the area accompanying his article. … Read more

Data Science Tells This Story About the Global Wine Markets 🍷

πŸ“– Background Many people like to relax or party with a glass of wine. That makes wine an important industry in many countries. Understanding this market is important to the livelihood of many people. For fun, consider the following fictional scenario: 🍷 Story: You work at a multinational consumer goods organization that is considering entering … Read more