numpy.set_string_function()

numpy.set_string_function(f, repr=True) [source] Set a Python function to be used when pretty printing arrays. Parameters: f : function or None Function to be used to pretty print arrays. The function should expect a single array argument and return a string of the representation of the array. If None, the function is reset to the default NumPy function to print arrays. repr : bool, optional If True (default), the function for pretty printing (__repr__) is set, if False the function tha

numpy.set_printoptions()

numpy.set_printoptions(precision=None, threshold=None, edgeitems=None, linewidth=None, suppress=None, nanstr=None, infstr=None, formatter=None) [source] Set printing options. These options determine the way floating point numbers, arrays and other NumPy objects are displayed. Parameters: precision : int, optional Number of digits of precision for floating point output (default 8). threshold : int, optional Total number of array elements which trigger summarization rather than full repr

numpy.setxor1d()

numpy.setxor1d(ar1, ar2, assume_unique=False) [source] Find the set exclusive-or of two arrays. Return the sorted, unique values that are in only one (not both) of the input arrays. Parameters: ar1, ar2 : array_like Input arrays. assume_unique : bool If True, the input arrays are both assumed to be unique, which can speed up the calculation. Default is False. Returns: setxor1d : ndarray Sorted 1D array of unique values that are in only one of the input arrays. Examples >>>

numpy.seterrobj()

numpy.seterrobj(errobj) Set the object that defines floating-point error handling. The error object contains all information that defines the error handling behavior in Numpy. seterrobj is used internally by the other functions that set error handling behavior (seterr, seterrcall). Parameters: errobj : list The error object, a list containing three elements: [internal numpy buffer size, error mask, error callback function]. The error mask is a single integer that holds the treatment infor

numpy.seterrcall()

numpy.seterrcall(func) [source] Set the floating-point error callback function or log object. There are two ways to capture floating-point error messages. The first is to set the error-handler to ?call?, using seterr. Then, set the function to call using this function. The second is to set the error-handler to ?log?, using seterr. Floating-point errors then trigger a call to the ?write? method of the provided object. Parameters: func : callable f(err, flag) or object with write method Fun

numpy.seterr()

numpy.seterr(all=None, divide=None, over=None, under=None, invalid=None) [source] Set how floating-point errors are handled. Note that operations on integer scalar types (such as int16) are handled like floating point, and are affected by these settings. Parameters: all : {?ignore?, ?warn?, ?raise?, ?call?, ?print?, ?log?}, optional Set treatment for all types of floating-point errors at once: ignore: Take no action when the exception occurs. warn: Print a RuntimeWarning (via the Python w

numpy.setdiff1d()

numpy.setdiff1d(ar1, ar2, assume_unique=False) [source] Find the set difference of two arrays. Return the sorted, unique values in ar1 that are not in ar2. Parameters: ar1 : array_like Input array. ar2 : array_like Input comparison array. assume_unique : bool If True, the input arrays are both assumed to be unique, which can speed up the calculation. Default is False. Returns: setdiff1d : ndarray Sorted 1D array of values in ar1 that are not in ar2. See also numpy.lib.arrayset

numpy.setbufsize()

numpy.setbufsize(size) [source] Set the size of the buffer used in ufuncs. Parameters: size : int Size of buffer.

numpy.select()

numpy.select(condlist, choicelist, default=0) [source] Return an array drawn from elements in choicelist, depending on conditions. Parameters: condlist : list of bool ndarrays The list of conditions which determine from which array in choicelist the output elements are taken. When multiple conditions are satisfied, the first one encountered in condlist is used. choicelist : list of ndarrays The list of arrays from which the output elements are taken. It has to be of the same length as c

numpy.searchsorted()

numpy.searchsorted(a, v, side='left', sorter=None) [source] Find indices where elements should be inserted to maintain order. Find the indices into a sorted array a such that, if the corresponding elements in v were inserted before the indices, the order of a would be preserved. Parameters: a : 1-D array_like Input array. If sorter is None, then it must be sorted in ascending order, otherwise sorter must be an array of indices that sort it. v : array_like Values to insert into a. side