numpy.core.defchararray.decode()

numpy.core.defchararray.decode(a, encoding=None, errors=None) [source] Calls str.decode element-wise. The set of available codecs comes from the Python standard library, and may be extended at runtime. For more information, see the codecs module. Parameters: a : array_like of str or unicode encoding : str, optional The name of an encoding errors : str, optional Specifies how to handle encoding errors Returns: out : ndarray See also str.decode Notes The type of the result will depe

numpy.core.defchararray.count()

numpy.core.defchararray.count(a, sub, start=0, end=None) [source] Returns an array with the number of non-overlapping occurrences of substring sub in the range [start, end]. Calls str.count element-wise. Parameters: a : array_like of str or unicode sub : str or unicode The substring to search for. start, end : int, optional Optional arguments start and end are interpreted as slice notation to specify the range in which to count. Returns: out : ndarray Output array of ints. See al

numpy.core.defchararray.capitalize()

numpy.core.defchararray.capitalize(a) [source] Return a copy of a with only the first character of each element capitalized. Calls str.capitalize element-wise. For 8-bit strings, this method is locale-dependent. Parameters: a : array_like of str or unicode Input array of strings to capitalize. Returns: out : ndarray Output array of str or unicode, depending on input types See also str.capitalize Examples >>> c = np.array(['a1b2','1b2a','b2a1','2a1b'],'S4'); c array(['a1b2

numpy.core.defchararray.center()

numpy.core.defchararray.center(a, width, fillchar=' ') [source] Return a copy of a with its elements centered in a string of length width. Calls str.center element-wise. Parameters: a : array_like of str or unicode width : int The length of the resulting strings fillchar : str or unicode, optional The padding character to use (default is space). Returns: out : ndarray Output array of str or unicode, depending on input types See also str.center

numpy.core.defchararray.asarray()

numpy.core.defchararray.asarray(obj, itemsize=None, unicode=None, order=None) [source] Convert the input to a chararray, copying the data only if necessary. Versus a regular Numpy array of type str or unicode, this class adds the following functionality: values automatically have whitespace removed from the end when indexed comparison operators automatically remove whitespace from the end when comparing values vectorized string operations are provided as methods (e.g. str.endswith) and inf

numpy.core.defchararray.array()

numpy.core.defchararray.array(obj, itemsize=None, copy=True, unicode=None, order=None) [source] Create a chararray. Note This class is provided for numarray backward-compatibility. New code (not concerned with numarray compatibility) should use arrays of type string_ or unicode_ and use the free functions in numpy.char for fast vectorized string operations instead. Versus a regular Numpy array of type str or unicode, this class adds the following functionality: values automatically have

numpy.copyto()

numpy.copyto(dst, src, casting='same_kind', where=None) Copies values from one array to another, broadcasting as necessary. Raises a TypeError if the casting rule is violated, and if where is provided, it selects which elements to copy. New in version 1.7.0. Parameters: dst : ndarray The array into which values are copied. src : array_like The array from which values are copied. casting : {?no?, ?equiv?, ?safe?, ?same_kind?, ?unsafe?}, optional Controls what kind of data casting may

numpy.copysign()

numpy.copysign(x1, x2[, out]) = Change the sign of x1 to that of x2, element-wise. If both arguments are arrays or sequences, they have to be of the same length. If x2 is a scalar, its sign will be copied to all elements of x1. Parameters: x1 : array_like Values to change the sign of. x2 : array_like The sign of x2 is copied to x1. out : ndarray, optional Array into which the output is placed. Its type is preserved and it must be of the right shape to hold the output. See doc.ufuncs.

numpy.core.defchararray.add()

numpy.core.defchararray.add(x1, x2) [source] Return element-wise string concatenation for two arrays of str or unicode. Arrays x1 and x2 must have the same shape. Parameters: x1 : array_like of str or unicode Input array. x2 : array_like of str or unicode Input array. Returns: add : ndarray Output array of string_ or unicode_, depending on input types of the same shape as x1 and x2.

numpy.conj()

numpy.conj(x[, out]) = Return the complex conjugate, element-wise. The complex conjugate of a complex number is obtained by changing the sign of its imaginary part. Parameters: x : array_like Input value. Returns: y : ndarray The complex conjugate of x, with same dtype as y. Examples >>> np.conjugate(1+2j) (1-2j) >>> x = np.eye(2) + 1j * np.eye(2) >>> np.conjugate(x) array([[ 1.-1.j, 0.-0.j], [ 0.-0.j, 1.-1.j]])