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

Function lower

numpy/core/defchararray.py:1104–1135  ·  view source on GitHub ↗

Return an array with the elements converted to lowercase. Call `str.lower` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like, {str, unicode} Input array. Returns ------- out : ndarray, {str, unicode

(a)

Source from the content-addressed store, hash-verified

1102
1103@array_function_dispatch(_unary_op_dispatcher)
1104def lower(a):
1105 """
1106 Return an array with the elements converted to lowercase.
1107
1108 Call `str.lower` element-wise.
1109
1110 For 8-bit strings, this method is locale-dependent.
1111
1112 Parameters
1113 ----------
1114 a : array_like, {str, unicode}
1115 Input array.
1116
1117 Returns
1118 -------
1119 out : ndarray, {str, unicode}
1120 Output array of str or unicode, depending on input type
1121
1122 See Also
1123 --------
1124 str.lower
1125
1126 Examples
1127 --------
1128 >>> c = np.array(['A1B C', '1BCA', 'BCA1']); c
1129 array(['A1B C', '1BCA', 'BCA1'], dtype='<U5')
1130 >>> np.char.lower(c)
1131 array(['a1b c', '1bca', 'bca1'], dtype='<U5')
1132
1133 """
1134 a_arr = numpy.asarray(a)
1135 return _vec_string(a_arr, a_arr.dtype, 'lower')
1136
1137
1138def _strip_dispatcher(a, chars=None):

Callers 1

lowerMethod · 0.85

Calls 1

_vec_stringFunction · 0.90

Tested by

no test coverage detected