Python

NumPy sqrt() - Square Root of Matrix Elements — step-by-step Python tutorial on Progressive Robot

NumPy sqrt() – Square Root of Matrix Elements

URL: https://www.progressiverobot.com/numpy-sqrt-square-root-of-matrix-elements/ [Python NumPy module](/community/tutorials/python-numpy-tutorial) is used to work with multidimensional arrays and matrix manipulations. We can use NumPy sqrt() function to get the square root of the matrix elements. Python NumPy sqrt() Example import numpy array_2d = numpy.array([[1, 4], [9, 16]], dtype=numpy.float) print(array_2d) array_2d_sqrt = numpy.sqrt(array_2d) print(array_2d_sqrt) Output: [[ 1. 4.] [ 9. 16.]] […]

Read more
Permutations and Combinations in Python — step-by-step Python tutorial on Progressive Robot

Permutations and Combinations in Python

URL: https://www.progressiverobot.com/permutation-and-combinatios-in-python/ Permutations and Combinations of a set of elements are different arrangements of the elements of the set. Combination is a collection of the elements where the order doesn't matter Permutation is an arrangement of a set where the order does matter. Let's consider a set as : {A, B, C} The permutations of the above […]

Read more
Python f-strings - PEP 498 - Literal String Interpolation — step-by-step Python tutorial on Progressive Robot

Python f-strings – PEP 498 – Literal String Interpolation

URL: https://www.progressiverobot.com/python-f-strings-literal-string-interpolation/ Python f-strings or formatted strings are the new way to format strings. This feature was introduced in Python 3.6 under PEP-498. It's also called literal string interpolation. Why do we need f-strings? Python provides various ways to format a string. Let's quickly look at them and what are the issues they have. % […]

Read more
Python main function — step-by-step Python tutorial on Progressive Robot

Python main function

URL: https://www.progressiverobot.com/python-main-function/ Python main function is executed only when it's being executed as a python program. As you know, we can also [import](/community/tutorials/python-input-output-python-import) a python program as a module, in that case python main method should not execute. Python main function Main function is the entry point of any program. But python interpreter executes the […]

Read more
How to Read Properties File in Python? — step-by-step Python tutorial on Progressive Robot

How to Read Properties File in Python?

URL: https://www.progressiverobot.com/python-read-properties-file/ We can use jproperties module to read properties file in Python. A properties file contains key-value pairs in each line. The equals (=) works as the delimiter between the key and value. A line that starts with # is treated as a comment. Installing jproperties Library This module is not part of the […]

Read more
Python String contains — step-by-step Python tutorial on Progressive Robot

Python String contains

Learn how to check if one Python string contains another using the __contains__() method. This case-sensitive instance method returns True or False based on whether the specified substring is present. Explore simple examples and user-input scenarios to understand its application. Enhance your Python string-handling skills with practical demonstrations and clear explanations.

Read more
How To Trim Whitespace from a String in Python — step-by-step Python tutorial on Progressive Robot

How To Trim Whitespace from a String in Python

URL: https://www.progressiverobot.com/python-trim-string-rstrip-lstrip-strip/ Introduction Python provides three methods that you can use to trim whitespace from a string and return a new string object. The string strip methods can trim leading whitespace, trailing whitespace, or both. To learn more about removing whitespace, including how to remove all whitespace or only duplicate spaces, refer to How To […]

Read more
Seaborn Kdeplot - A Comprehensive Guide — step-by-step Python tutorial on Progressive Robot

Seaborn Kdeplot – A Comprehensive Guide

URL: https://www.progressiverobot.com/seaborn-kdeplot/ Hey, folks! In our Seaborn tutorial, we will be focusing on Seaborn Kdeplot. What is Kdeplot? Kdeplot is a Kernel Distribution Estimation Plot which depicts the probability density function of the continuous or non-parametric data variables i.e. we can plot for the univariate or multiple variables altogether. Using the Python Seaborn module, we […]

Read more
CHAT