AmitDiwan has Published 11360 Articles

Generate a Vandermonde matrix and set the number of columns in the output in Numpy

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 09:37:20

229 Views

To generate a Vandermonde matrix, use the np.ma.vander() method in Python Numpy. Set the number of columns in the output using the N parameter. If N is not specified, a square array is returned (N = len(x)).The columns of the output matrix are powers of the input vector. The order ... Read More

Java Program to Check Whether a Number can be Expressed as Sum of Two Prime Numbers

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 09:28:18

821 Views

In this article, we will understand how to check whether a number can be expressed as sum of two prime numbers. Prime numbers are special numbers who have only two factors 1 and itself and cannot be divided by any other number.A number is a prime number if its only ... Read More

Java Program to Make a Simple Calculator Using switch...case

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 09:22:12

4K+ Views

In this article, we will understand how to construct a simple calculator using switch-case. The switch statement evaluates an expression, matching the expression's value to a case clause, and executes statements associated with that case.Following are the arithmetic operations we are going to perform.AdditionSubtractionMultiplicationDivisionFloor DivisionModuloBelow is a demonstration of the ... Read More

Java Program to Display Factors of a Number

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 08:15:19

6K+ Views

In this article, we will understand how to display factors of a number. Factor are number that divides another number or expression evenly.Factors are the numbers we multiply to get another number. For example, if we multiply 3 and 5, we get 15. We say, 3 and 5 are factors ... Read More

Generate a Vandermonde matrix in Numpy

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 08:13:21

143 Views

To generate a Vandermonde matrix, use the np.ma.vander() method in Python Numpy. A Vandermonde matrix, named after Alexandre-Théophile Vandermonde, is a matrix with the terms of a geometric progression in each row.The columns of the output matrix are powers of the input vector. The order of the powers is determined ... Read More

Return the outer product of two masked One-Dimensional Numpy arrays

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 08:07:47

102 Views

To return the outer product of two masked 1D arrays, use the ma.outer() method in Python Numpy. The first parameter is the input vector. Input is flattened if not already 1-dimensional. The second parameter is the second input vector. Input is flattened if not already 1-dimensional.A masked array is the ... Read More

Return the outer product of two masked Three-Dimensional Numpy arrays

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 08:03:28

218 Views

To return the outer product of two 3D masked arrays, use the ma.outer() method in Python Numpy. The first parameter is the input vector. Input is flattened if not already 1-dimensional. The second parameter is the second input vector. Input is flattened if not already 1-dimensional.A masked array is the ... Read More

Java Program to Display Prime Numbers Between Intervals Using Function

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 07:59:51

389 Views

In this article, we will understand how to display prime numbers between intervals using function. Prime numbers are special numbers who have only two factors 1 and itself and cannot be divided by any other number.A number is a prime number if its only factors are 1 and itself. 11 ... Read More

Return the outer product of two masked arrays in Numpy

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 07:58:48

91 Views

To return the outer product of two masked arrays, use the ma.outer() method in Python Numpy. The first parameter is the input vector. Input is flattened if not already 1-dimensional. The second parameter is the second input vector. Input is flattened if not already 1-dimensional.A masked array is the combination ... Read More

Mask rows and/or columns of a 2D Numpy array that contain masked values along negative axis

AmitDiwan

AmitDiwan

Updated on 22-Feb-2022 07:52:18

447 Views

To mask rows and/or columns of a 2D array that contain masked values, use the np.ma.mask_rowcols() method in Numpy. The function returns a modified version of the input array, masked depending on the value of the axis parameter.Mask whole rows and/or columns of a 2D array that contain masked values. ... Read More

Advertisements