Prompt for user input & read command-line arguments in Python

In this Python tutorial, we will learn how to prompt for user input and read command-line arguments in Python Programming language. This enhances the productivity and functionality, when we can directly take the input from user while executing the program. Table Of Contents Introduction User Input Method 1 : Using the Sys module Method 2 …

Prompt for user input & read command-line arguments in Python Read More »

What is __ init __.py in Python? – Give an example

When developing multiple python packages and codes, or working with multiple directories, we often come across the __ init __.py file in Python programming language. In this article, we will learn, what is __ init __.py file? Also, we will learn about Python packages and also python programming language directory structure. Table Of Contents What …

What is __ init __.py in Python? – Give an example Read More »

What is `__init__` method in Python class?

In Python OOPS programming every one must have come through this __init__() method. In this Python tutorial, we will learn What is __init__ method in Python class. Table Of Contents Introduction to __init__() method __init__ and Inheritance Summary Introduction to __init__() method In Object-Oriented Programming, we have constructors, which are used to initialize the member …

What is `__init__` method in Python class? Read More »

Normalize a NumPy array to a unit vector in Python

In this article, we will learn how to normalize a NumPy array to a unit vector. Table Of Contents What is Normalization? What is a Unit vector? Method 1: Using unit_vector() method from transformations library Method 2: Using normalize() method from vg module. Method 3: Using linalg.norm() method from numpy module Method 4: Calculating norm …

Normalize a NumPy array to a unit vector in Python Read More »

Calculate Euclidean distance using NumPy in Python

In this article we will learn How to calculate euclidean distance using numpy in Python. Table Of Contents What is euclidean distance? Calculate euclidean distance using sqrt() and sum() methods of numpy Calculate euclidean distance using norm() function Calculate euclidean distance using dot() Calculate euclidean distance using vdot() Calculate euclidean distance using np.linalg.multi_dot() Summary What …

Calculate Euclidean distance using NumPy in Python Read More »

Scroll to Top