Symbolic Math with SymPy

This article shows how to solve math equations and expressions symbolically, in Python. Thanks to the Sympy library, this turns out to be an extremely easy task. However, as you will see in the following examples, the number of tools and functions provided by this library is huge. Thanks to all its features, Sympy represents … Read more

NumPy Dot Product

Numpy is a popular Python library for data science focusing on arrays, vectors, and matrices. An important application of arrays, matrices, and vectors is the dot product. This article will teach you everything you need to know to get started! The dot product behaves differently for different input arrays. Dot Product 1D array and Scalar … Read more

[Numpy * Operator] Element-wise Multiplication in Python

NumPy is a popular Python library for data science. Numpy focuses on array, vector, and matrix computations. If you work with data, you cannot avoid NumPy. So learn it now and learn it well. In this tutorial, you’ll learn how to calculate the Hadamard Product (= element-wise multiplication) of two 1D lists, 1D arrays, or … Read more

A Guide to Python’s pow() Function

Exponents are superscript numbers that describe how many times you want to multiply a number by itself. Calculating a value raised to the power of another value is a fundamental operation in applied mathematics such as finance, machine learning, statistics, and data science. This tutorial shows you how to do it in Python! Definition For … Read more

Recursive Power Function: Are You Stuck With This Sololearn Code?

If you learn Python with the excellent Sololearn app, you may find yourself with this code snippet: What’s the output of this code snippet? And, most importantly, how does it work? This short guide will tell you! The code creates a function that returns x^y. It leverages the important programming concept of recursion: it calls … Read more