- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1204 Articles for Numpy
87 Views
To return the result of the power to which the input value is raised with scimath, use the scimath.power() method in Python. Returns x to the power p, i.e. the result of x**p. If x and p are scalars, so is out, otherwise an array is returned.If x contains negative values, the output is converted to the complex domain. The parameter x is the input value. The parameter p is the power(s) to which x is raised. If x contains multiple values, p has to either be a scalar, or contain the same number of values as x. In the ... Read More
161 Views
To return the result of the power to which the input value is raised with scimath, use the scimath.power() method in Python. Returns x to the power p, i.e. the result of x**p. If x and p are scalars, so is out, otherwise an array is returned. If x contains negative values, the output is converted to the complex domain. The parameter x is the input valueThe parameter p is the power(s) to which x is raised. If x contains multiple values, p has to either be a scalar, or contain the same number of values as x. In the ... Read More
81 Views
To return the result of the power to which the input value is raised with scimath, use the scimath.power() method in Python. Returns x to the power p, i.e. the result of x**p. If x and p are scalars, so is out, otherwise an array is returned. If x contains negative values, the output is converted to the complex domain. The parameter x is the input valueThe parameter p is the power(s) to which x is raised. If x contains multiple values, p has to either be a scalar, or contain the same number of values as x. In the ... Read More
116 Views
To compute the logarithm base 10 with scimath, use the scimath.log10() method in Python Numpy. The method returns the log base 10 of the x value(s). If x was a scalar, so is out, otherwise an array object is returned.For a log10() that returns NAN when real x < 0, use numpy.log10 (note, however, that otherwise numpy.log10 and this log10 are identical, i.e., both return -inf for x = 0, inf for x = inf, and, notably, the complex principle value if x.imag != 0). The 1st parameter, x is the value(s) whose log base 10 is (are) required.StepsAt first, ... Read More
300 Views
To compute the logarithm base n with scimath, use the scimath.logn() method in Python Numpy. The method returns the log base n of the x value(s). If x was a scalar, so is out, otherwise an array is returned.If x contains negative inputs, the answer is computed and returned in the complex domain. The 1st parameter, n is the integer base(s) in which the log is taken. The 2nd parameter, x is the value(s) whose log base n is (are) required.StepsAt first, import the required libraries −import numpy as npCreating a numpy array using the array() method −arr = np.array([-4, ... Read More
154 Views
To compute the logarithm base 2 with scimath, use the np.emath.log2() method in Python Numpy. The method returns the log base 2 of the x value(s). If x was a scalar, so is out, otherwise an array is returned. The 1st parameter, x is the value(s) whose log base 2 is (are) required.StepsAt first, import the required libraries −import numpy as npCreating a numpy array using the array() method −arr = np.array([np.inf, -np.inf, 16, np.exp(1), -np.exp(1), -32]) Display the array −print("Our Array...", arr)Check the Dimensions −print("Dimensions of our Array...", arr.ndim) Get the Datatype −print("Datatype of our Array object...", arr.dtype)Get the ... Read More
112 Views
To compute the natural logarithm with scimath, use the np.emath.log() method in Python Numpy. The method returns the log of the x value(s). If x was a scalar, so is out, otherwise an array is returned. The 1st parameter, x is the value(s) whose log is (are) required.StepsAt first, import the required libraries −import numpy as npCreating a numpy array using the array() method −arr = np.array([np.inf, -np.inf, np.exp(1), -np.exp(1)]) Display the array −print("Our Array...", arr)Check the Dimensions −print("Dimensions of our Array...", arr.ndim) Get the Datatype −print("Datatype of our Array object...", arr.dtype)Get the Shape −print("Shape of our Array object...", arr.shape) ... Read More
130 Views
To compute the square root of input, use the emath.sqrt() method in Python Numpy. The method returns the square root of x. If x was a scalar, so is out, otherwise an array is returned. The parameter x is the input value. For negative input elements, a complex value is returnedStepsAt first, import the required libraries −import numpy as npThe complex input explicity using complex() method −a = complex(-9.0, 0.0) Display the array −print("Display the complex value...", a)To compute the square root of input, use the emath.sqrt() method in Python Numpy −print("Result...", np.emath.sqrt(a)) Exampleimport numpy as np # Explicity ... Read More
165 Views
To compute the square root of input, use the scimath.sqrt() method in Python Numpy. The method returns the square root of x. If x was a scalar, so is out, otherwise an array is returned. The parameter x is the input value. For negative input elements, a complex value is returnedStepsAt first, import the required libraries −import numpy as npCreating a numpy array using the array() method −arr = np.array([1, -4, -9, 16, -25, 36]) Display the array −print("Our Array...", arr)Check the Dimensions −print("Dimensions of our Array...", arr.ndim) Get the Datatype −print("Datatype of our Array object...", arr.dtype)Get the Shape −print("Shape ... Read More