numpy.absolute()

numpy.absolute(x[, out]) = Calculate the absolute value element-wise. Parameters: x : array_like Input array. Returns: absolute : ndarray An ndarray containing the absolute value of each element in x. For complex input, a + ib, the absolute value is . Examples >>> x = np.array([-1.2, 1.2]) >>> np.absolute(x) array([ 1.2, 1.2]) >>> np.absolute(1.2 + 1j) 1.5620499351813308 Plot the function over [-10, 10]: >>> import matplotlib.pyplot as plt >

Numpy-specific help functions

Finding help lookfor(what[, module, import_modules, ...]) Do a keyword search on docstrings. Reading help info([object, maxwidth, output, toplevel]) Get help information for a function, class, or module. source(object[, output]) Print or write to a file the source code for a Numpy object.

Numpy C Code Explanations

Fanaticism consists of redoubling your efforts when you have forgotten your aim. ? George Santayana An authority is a person who can tell you more about something than you really care to know. ? Unknown This Chapter attempts to explain the logic behind some of the new pieces of code. The purpose behind these explanations is to enable somebody to be able to understand the ideas behind the implementation somewhat more easily than just staring at the code. Perhaps in this way, the algorithms ca

NPY_SIZEOF_SHORT

When NumPy is built, information about system configuration is recorded, and is made available for extension modules using Numpy?s C API. These are mostly defined in numpyconfig.h (included in ndarrayobject.h). The public symbols are prefixed by NPY_*. Numpy also offers some functions for querying information about the platform in use. For private use, Numpy also constructs a config.h in the NumPy include directory, which is not exported by Numpy (that is a python extension which use the numpy

NPY_NAN

New in version 1.3.0. Starting from numpy 1.3.0, we are working on separating the pure C, ?computational? code from the python dependent code. The goal is twofolds: making the code cleaner, and enabling code reuse by other extensions outside numpy (scipy, etc...). Numpy core math library The numpy core math library (?npymath?) is a first step in this direction. This library contains most math-related C99 functionality, which can be used on platforms where C99 is not well supported. The core

NPY_BOOL

The standard array can have 24 different data types (and has some support for adding your own types). These data types all have an enumerated type, an enumerated type-character, and a corresponding array scalar Python type object (placed in a hierarchy). There are also standard C typedefs to make it easier to manipulate elements of the given data type. For the numeric types, there are also bit-width equivalent C typedefs and named typenumbers that make it easier to select the precision desired

NpyIter

New in version 1.6. Array Iterator The array iterator encapsulates many of the key features in ufuncs, allowing user code to support features like output parameters, preservation of memory layouts, and buffering of data with the wrong alignment or type, without requiring difficult coding. This page documents the API for the iterator. The iterator is named NpyIter and functions are named NpyIter_*. There is an introductory guide to array iteration which may be of interest for those using thi

nditer.reset()

nditer.reset() Reset the iterator to its initial state.

nditer.remove_multi_index()

nditer.remove_multi_index() When the ?multi_index? flag was specified, this removes it, allowing the internal iteration structure to be optimized further.

nditer.remove_axis()

nditer.remove_axis(i) Removes axis i from the iterator. Requires that the flag ?multi_index? be enabled.