In this blog, we will go through an important descriptive statistic of multi-variable data called the correlation matrix. We will learn how to create, plot, and manipulate correlation matrices in Python. We will be looking at the following topics: What is the correlation matrix? A correlation matrix is a tabular data representing the ‘correlations’ between pairs of variables in a ...

Read More »Home »

## How to Loop Over a Dictionary in Python: Keys, Values, and More

Welcome to yet another How to Python article. Today, we’ll be looking at looping over dictionaries which appears to be a hot topic—at least by an organic standpoint. As it turns out, there are few ways to get it done. First, we could loop over the keys directly: for key in dictionary. Alternatively, we might only need to loop over the ...

Read More »## NumPy Where Tutorial (With Examples)

Looking up for entries that satisfy a specific condition is a painful process, especially if you are searching it in a large dataset having hundreds or thousands of entries. If you know the fundamental SQL queries, you must be aware of the ‘WHERE’ clause that is used with the SELECT statement to fetch such entries from a relational database that ...

Read More »## Python humanize time-interval without Arrow or Humanize libraries

Sometimes when we need to debug functions in Python, we need a way to write some quick timer code to capture the time-delta and to compute the time it took for the function to execute. This article shows you a quick and easy way to humanize a time-interval/time-delta without bringing in additional dependencies or libraries like Arrow or Humanize. 1 ...

Read More »## Exiting/Terminating Python Scripts (Simple Examples)

Today, we’ll be diving into the topic of exiting/terminating Python scripts! Before we get started, you should have a basic understanding of what Python is and some basic knowledge about its use. You can use the IDE of your choice, but I’ll use Microsoft’s Linux Subsystem for Windows (WSL) package this time. For more information on that and how you ...

Read More »## 20+ Examples For NumPy Matrix Multiplication

In this tutorial, we will look at various ways of performing matrix multiplication using NumPy arrays. we will learn how to multiply matrices with different sizes together. Also. we will learn how to speed up the multiplication process using GPU and other hot topics, so let’s get started! Before we move ahead, it is better to review some basic terminologies of ...

Read More »## Caesar Cipher In Python (Text Encryption Tutorial)

Cryptography deals with encrypting or encoding a piece of information (in a plain text) into a form that looks gibberish and makes little sense in ordinary language.This encoded message(also called ciphertext) can then be decoded back into a plain text by the intended recipient using a decoding technique (often along with a private key) communicated to the end-user. Caesar Cipher is ...

Read More »## NumPy Loadtxt Tutorial (Load Data From Files)

In a previous tutorial, we talked about NumPy arrays and we saw how it makes the process of reading, parsing and performing operations on numeric data a cakewalk. In this tutorial, we will discuss the NumPy loadtxt method that is used to parse data from text files and store them in an n-dimensional NumPy array. Then we can perform all sorts of ...

Read More »## 20+ Examples For Flattening Lists In Python

Flattening lists means converting a multidimensional or nested list into a one-dimensional list. For example, the process of converting this [[1,2], [3,4]] list to [1,2,3,4] is called flattening. The process of flattening is very easy as we’ll see. You will learn how to flatten different shapes of lists with different techniques. So, let’s jump in A list of lists Let’s ...

Read More »