AmitDiwan has Published 11360 Articles

Convert angles from degrees to radians in Python

AmitDiwan

AmitDiwan

Updated on 24-Feb-2022 07:31:44

2K+ Views

To convert angles from degrees to radians, use the numpy.radians() method in Python Numpy. The method returns the corresponding radian values. This is a scalar if x is a scalar. The 1st parameter is an input array in degrees. The 2nd and 3rd parameters are optional.The 2nd parameter is an ... Read More

Compute the Natural Logarithm in Python

AmitDiwan

AmitDiwan

Updated on 24-Feb-2022 07:28:53

257 Views

The natural logarithm log is the inverse of the exponential function, so that log(exp(x)) = x. The natural logarithm is logarithm in base e. The method returns the natural logarithm of x, elementwise. This is a scalar if x is a scalar. The 1st parameter is the input value, array-like. ... Read More

Python - Merge DataFrames of different length

AmitDiwan

AmitDiwan

Updated on 23-Feb-2022 13:20:27

469 Views

To merge dataframes of different length, we need to use the merge() method. Let’s say the following is our 1st DataFrame with length 4 −dataFrame1 = pd.DataFrame(    {       "Car": ['BMW', 'Lexus', 'Audi', 'Jaguar']    } ) print("DataFrame1 ...", dataFrame1) print("DataFrame1 length = ", len(dataFrame1))Following is ... Read More

Java Program to Print Pyramid Star Pattern

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 13:19:45

557 Views

In this article, we will understand how to print pyramid star pattern. The pattern is formed by using multiple for-loops and print statements.Below is a demonstration of the same −InputSuppose our input is −Enter the number of rows : 8OutputThe desired output would be −The pyramid star pattern : ... Read More

Java Program to Print the Left Triangle Star Pattern

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 12:32:38

633 Views

In this article, we will understand how to print left triangle star pattern. The pattern is formed by using multiple for-loops and print statements.Below is a demonstration of the same −InputSuppose our input is −Enter the number of rows : 8OutputThe desired output would be −The right triangle star pattern ... Read More

Java Program to Print Left Triangle Star Pattern

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 12:24:23

618 Views

In this article, we will understand how to print left triangle star pattern. The pattern is formed by using multiple for-loops and print statements.Below is a demonstration of the same −InputSuppose our input is −Enter the number of rows : 8OutputThe desired output would be −* * * * * ... Read More

Java Program to Check if An Array Contains the Given Value

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 11:03:43

960 Views

In this article, we will understand how to check if an array contains the given value. This is accomplished by iterating upon the array elements and comparing the given input with the array elements.Below is a demonstration of the same −InputSuppose our input is −Enter the number to be searched: ... Read More

Java Program to Check Whether a Number is Even or Odd

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 10:42:25

588 Views

In this article, we will understand how to check whether a number is even or odd. This is accomplished by checking if the given number is divisible by 2.Below is a demonstration of the same −InputSuppose our input is −Enter the number : 45OutputThe desired output would be −The number ... Read More

Java Program to Find Sum of N Numbers Using Recursion

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 10:38:14

397 Views

In this article, we will understand how to find sum of N numbers using recursion. A recursive function is a function that calls itself multiple times until a particular condition is satisfied.Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you ... Read More

Java Program to Find the Product of Two Numbers Using Recursion

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 10:31:13

496 Views

In this article, we will understand how to find the product of two numbers using recursion. A recursive function is a function that calls itself multiple times until a particular condition is satisfied.Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows ... Read More

Advertisements