Python Dash Book

We’ve just launched the first in-depth Python Plotly Dash book with the world’s #1 computer science book publisher NoStarch. You can order Python Dash on Amazon or NoStarch directly. Book Description A swift and practical introduction to building interactive data visualization apps in Python, known as dashboards. You’ve seen dashboards before; think election result visualizations … Read more

How to Display an Image as Grayscale in Python Matplotlib?

How to Display an Image as Grayscale in Python Matplotlib? You can convert a given image to a grayscale image using four simple steps: Import the PIL and Matplotlib libraries Open the image with PIL.Image.open(filename). Convert the opened image to grayscale using img.convert(“L”) with greyscale mode “L”. Display the image using Matplotlib’s plt.imshow(gray_img, cmap=’gray’) function. … Read more

Your First Dash App – How to Get Started in 4 Minutes or Less

Minute 1: Install Dash Type the following command in your terminal/shell. Windows, macOS: Linux, Ubuntu: Minute 2: Create Minimal Dash Project File “app.py” Copy&paste the code into a new file called β€œapp.py” in a folder – with path /path/to/dash_app/app.py: Minute 3: Run Dash App Open a terminal or shell in the /path/to/dash_app/ and run python … Read more

Conditional Indexing: How to Conditionally Select Elements in a NumPy Array?

Selective Indexing

Problem Description: You have a Numpy array. You want to select specific elements from the array. But neither slicing nor indexing seem to solve your problem. What can you do? In this short tutorial, I show you how to select specific Numpy array elements via Boolean matrices. A feature called conditional indexing or selective indexing. … Read more

Akkio – How to Add Machine Learning to Your Python Project in 30 Lines

AI is hard! Transforming tensors, cleaning data, building complicated networks- these are all specialized skills that can take months or even years to learn. But the times are a-changin’. Businesses understand that adopting state-of-the-art AI is no longer a choice.  Of course, those burdened with actually implementing that AI are the software devs. High-level talk … Read more

How to Get an HTML Page from a URL in Python?

This tutorial shows you how to perform simple HTTP get requests to get an HTML page from a given URL in Python! Problem Formulation Given a URL as a string. How to extract the HTML from the given URL and store the result in a Python string variable? Example: Say, you want to accomplish the … Read more