MCPcopy Create free account
hub / github.com/numpy/numpy / mod

Function mod

numpy/core/defchararray.py:395–419  ·  view source on GitHub ↗

Return (a % i), that is pre-Python 2.6 string formatting (interpolation), element-wise for a pair of array_likes of str or unicode. Parameters ---------- a : array_like of str or unicode values : array_like of values These values will be element-wise interpolate

(a, values)

Source from the content-addressed store, hash-verified

393
394@array_function_dispatch(_mod_dispatcher)
395def mod(a, values):
396 """
397 Return (a % i), that is pre-Python 2.6 string formatting
398 (interpolation), element-wise for a pair of array_likes of str
399 or unicode.
400
401 Parameters
402 ----------
403 a : array_like of str or unicode
404
405 values : array_like of values
406 These values will be element-wise interpolated into the string.
407
408 Returns
409 -------
410 out : ndarray
411 Output array of str or unicode, depending on input types
412
413 See Also
414 --------
415 str.__mod__
416
417 """
418 return _to_bytes_or_str_array(
419 _vec_string(a, object_, '__mod__', (values,)), a)
420
421
422@array_function_dispatch(_unary_op_dispatcher)

Callers 3

test_modMethod · 0.90
__mod__Method · 0.70
unwrapFunction · 0.50

Calls 2

_vec_stringFunction · 0.90
_to_bytes_or_str_arrayFunction · 0.85

Tested by 1

test_modMethod · 0.72