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.chararray

class numpy.core.defchararray.chararray [source] Provides a convenient view on arrays of string and unicode values. Note The chararray class exists for backwards compatibility with Numarray, it is not recommended for new development. Starting from numpy 1.4, if one needs arrays of strings, it is recommended to use arrays of dtype object_, string_ or unicode_, and use the free functions in the numpy.char module for fast vectorized string operations. Versus a regular Numpy array of type str

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.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.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.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.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.copy()

numpy.copy(a, order='K') [source] Return an array copy of the given object. Parameters: a : array_like Input data. order : {?C?, ?F?, ?A?, ?K?}, optional Controls the memory layout of the copy. ?C? means C-order, ?F? means F-order, ?A? means ?F? if a is Fortran contiguous, ?C? otherwise. ?K? means match the layout of a as closely as possible. (Note that this function and :meth:ndarray.copy are very similar, but have different default values for their order= arguments.) Returns: arr :