Found 27104 Articles for Server Side Programming

Python - Replace list elements with its ordinal number.

Kalyan Mishra
Updated on 03-Oct-2023 15:15:47

109 Views

In this article we will learn how to replace any given list element with its ordinal number. We will see various methods to get this work done. Before that let’s know about ordinal numbers. Ordinal number − In mathematics we say ordinal number as number which represents the position or original order of list items present in a sequence. Take an example of a list: [ 6, 8, 5, 3 ] so ordinal value of these number would be − The first element (6) has ordinal value 1. The second element (8) has ordinal value 2. The third element ... Read More

Jacobian matrix in PyTorch

Kalyan Mishra
Updated on 03-Oct-2023 15:13:34

186 Views

In this article we will learn about the Jacobian matrix and how to calculate this matrix using different methods in PyTorch. We use Jacobian matrix in various machine learning applications. Jacobian Matrix We use Jacobian matrix to calculate relation between the input and output variable. Jacobian matrix has all the partial derivatives of vector valued function. We can use this matrix in various applications machine learning applications. Here are some of its usages − For analyzing the gradients and derivatives of functions in multivariable calculus. Solving differential equations of systems. Calculating inverse of vector-values functions. Analyzing stability of dynamic ... Read More

Iterating over rows and columns in Pandas DataFrame.

Kalyan Mishra
Updated on 03-Oct-2023 15:08:48

109 Views

In this article we will learn about pandas, DataFrame and how we can iterate over rows and columns in the pandas DataFrame using various methods. Iteration is a basic operation we do when we have tabular data containing rows and columns. To install the pandas in the system execute the command in cmd. pip install pandas Method 1. Using Iterrows() Method. Example import pandas as pd df = pd.DataFrame({'Name': ['Kalyan', 'Gungun', 'Sona', 'Ram'], 'Age': [21, 20, 23, 23], 'Roll': [12, 13, 14, 15], 'Game': ['Cricket', 'Lodu', 'Chess', ... Read More

Lumped Capacitance Analysis using Python

Dr Pankaj Dumka
Updated on 03-Oct-2023 13:14:11

130 Views

When an object at very high temperature is suddenly dropped in a cooler liquid and if it is assumed that the conductive resistance of the solid is very small in comparison to the surrounding convective resistance then the heat transfer analysis is called as lumped capacitance analysis (as shown in the figure given below). Here, we treat the system as a lump. In that case, we can assume that the rate of change of internal energy of lump will be equal to the heat interaction with the surrounding fluid. Mathematically, this can be written as − $$\mathrm{pcV\frac{\partial T}{\partial t} ... Read More

Implementation of Jacobi Method to Solve a System of Linear Equations in Python

Dr Pankaj Dumka
Updated on 03-Oct-2023 12:38:45

1K+ Views

It is the most straightforward iterative strategy for tackling systems of linear equations shown below. $$\mathrm{a_{1, 1}\: x_{1} \: + \: a_{1, 2} \: x_{2} \: + \: \dotso\dotso \: + \: a_{1, n} \: x_{n} \: = \: b_{1}}$$ $$\mathrm{a_{2, 1} \: x_{1} \: + \: a_{2, 2} \: x_{2} \: + \: \dotso\dotso \: + \: a_{2, n} \: x_{n} \: = \: b_{2}}$$ $$\mathrm{\vdots}$$ $$\mathrm{a_{n, 1} \: x_{1} \: + \: a_{n, 2} \: x_{2} \: + \: \dotso\dotso \: + \: a_{n, n} \: x_{n} \: = \: b_{n}}$$ The fundamental concept is: each linear ... Read More

Longest subsequence with different adjacent characters

Sonal Meenu Singh
Updated on 03-Oct-2023 11:57:52

127 Views

Introduction In this tutorial, we implement an approach to find the longest subsequence with different adjacent characters. Here, the longest subsequence is a subsequence that contains the maximum number of string characters with different adjacent characters. To implement the approach to finding the longest subsequence, consider a string s, and iterate We use two approaches to resolve the problem statement of finding the longest subsequence having different adjacent characters. Greedy ApproachIt is one of the most used algorithms to solve the data structure problem. This approach tries all possible cases and chooses the most suitable. Dynamic programmingIt ... Read More

How to validate image file extension using Regular Expression?

Sonal Meenu Singh
Updated on 03-Oct-2023 10:53:07

1K+ Views

Introduction In this article, we check validate image file extension using regular expressions. Image file extension in this article, is the valid extension for an image file which consists of file name and file extension . The valid image file extension follows some rules which we define in this article. Regular expression or regex is used for pattern matching in strings or string searching algorithms. Its functionalities are defined in the header file. It is used with a regex keyword followed by a variable. In this C++ tutorial, we check whether the input string is a valid image file ... Read More

How to check Aadhaar number is valid or not using Regular Expression?

Sonal Meenu Singh
Updated on 03-Oct-2023 10:41:26

3K+ Views

Introduction In this C++ tutorial, we check whether the input Aadhar number is valid using Regular Expression. Regular expression or regex is used for pattern matching in strings or string searching algorithms. Its functionalities are defined in the header file. It is used with a regex keyword followed by a variable. Indian citizens are issued an Aadhaar number, which is a unique identification number. It is a 12-digit unique number and no two people have a similar AADHAAR number. Syntax regex regular_expression_patternname return regex_match(value, regular_expression_patternname); In this tutorial to check the validity of an Aadhar number we ... Read More

Defanged Version of Internet Protocol Address

Sonal Meenu Singh
Updated on 03-Oct-2023 10:35:23

301 Views

Introduction This tutorial deals with the problem of finding the defanged version of the Internet Protocol Address. The Internet Protocol Address or IP Address is an individual numerical address of a device connected to or using the Internet. It is unique for every internet-connected device. It consists of numbers separated by the period (dot). An example would be 191.0.1.2. Defanged Version of Internet Protocol means replacing the periods (dot.) with other characters so that it is not treated as a valid IP address. For defanging the Internet Protocol Address we use [.] instead of periods ( dot .) The Internet ... Read More

How to decrypt a string according to given algorithm?

Sonal Meenu Singh
Updated on 03-Oct-2023 10:21:02

116 Views

Decryption or decrypt a string is the process used to protect confidential and sensitive data from hackers. It converts encrypted data or text into its original form. Encryption is the process of converting plain text into an unreadable and non-understandable cipher text format so that hackers cannot understand it. These processes are interrelated and involve various algorithms for processing. We decrypt the string according to the following algorithm. If the string length is odd. For odd index values append alphabets from the back of the string and for even index values append alphabets from the front of the input ... Read More

Advertisements