Combine Images Using Numpy

Summary: You can combine images represented in the form of Numpy arrays using the concatenate function of the Numpy library as np.concatenate((numpydata_1, numpydata_2), axis=1). This combines the images horizontally. Use syntax: np.concatenate((numpydata_1, numpydata_2), axis=0) to combine the images vertically. Problem Formulation Consider you have two images represented as Numpy arrays of pixels. How will you … Read more

Plotting Vector Fields and Gradients for ANN Gradient Descent

πŸ‘‰ This is a follow-up article to Gradient Descent in Neural Nets – A Simple Guide to ANN Learning – Finxter, where a lightweight introduction to Gradient Descent is given. In this article, you will learn how to produce the graphs in that article, especially the vector fields! Data visualization is an enlightening task in … Read more

Solidity Example – Safe Remote Purchase

This article continues on the Solidity Smart Contract Examples series, which implements a simple, but the useful process of safe remote purchase. Here, we’re walking through an example of a blind auction (docs). We’ll first lay out the entire smart contract example without the comments for readability and development purposes. Then we’ll dissect it part … Read more

How to Extract a Subset from a Dictionary in Python

Problem Formulation and Solution Overview This article will show you how to extract a subset from a Dictionary in Python. Our article works with a Dictionary called cars, containing 30 key:value pairs: a name and associated horsepower. πŸ’¬ Question: How would we write code to extract a subset from a Dictionary? We can accomplish this … Read more

How to Find All Palindromes in a Python String?

Coding Challenge πŸ’¬ Challenge: Given a string. How to find all palindromes in the string? For comprehensibility, allow me to quickly add a definition of the term palindrome: πŸ’‘ Definition: A palindrome is a sequence of characters that reads the same backward as forward such as ‘madam’, ‘anna’, or ‘101’. This article wants to give … Read more

How to Remove Multiple Keys from a Python Dictionary

Summary:Β You can use one of these methods to delete multiple keys from a dictionary Python –(1) Iterate across the list of keys to be deleted and use the syntax del dict[β€˜key’](2) Iterate across the list of keys to be deleted and call the dictionary.pop(key)method.(3) Eliminate unrequired keys and reconstruct the original dictionary using a dictionary … Read more

Compound for Developers: Yield Farming, Borrowing, Lending

This tutorial is in continuation of the first part of our DeFi series. In this part, let’s discuss the DeFi lending protocol Compound. πŸͺ™ Full DeFi Course: Click the link to access our free full DeFi course that’ll show you the ins and outs of decentralized finance (DeFi). Compound Operated by Compound, it is a … Read more

How to Filter a Dictionary in Python? (… The Most Pythonic Way)

Problem: Given a dictionary and a filter condition. How to filter a dictionary by … … key so that only those (key, value) pairs in the dictionary remain where the key satisfies the condition? … value so that only those (key, value) pairs remain where the value satisfies the condition? In this tutorial, you’ll learn … Read more

Find Longest Palindrome in a Python String (Easy)

Coding Challenge πŸ’¬ Challenge: Given a string. How to find the longest palindrome in the string? For comprehensibility, allow me to quickly add a definition of the term palindrome: πŸ’‘ Definition: A palindrome is a sequence of characters that reads the same backward as forward such as ‘madam’, ‘anna’, or ‘101’. This article wants to … Read more

How to Get a Random Entry from a Python Dictionary

Problem Formulation and Solution Overview This article will show you how to get a random entry from a Dictionary in Python. To make it more interesting, we have the following running scenario: πŸ‘¨β€πŸ« The Plot: Mr. Sinclair, an 8th great Science Teacher, is giving his students a quiz on the first 25 Periodic Table elements. … Read more