Return an array with the elements converted to lowercase. Call :meth:`str.lower` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype Input array. Returns
(a)
| 1122 | @set_module("numpy.strings") |
| 1123 | @array_function_dispatch(_unary_op_dispatcher) |
| 1124 | def lower(a): |
| 1125 | """ |
| 1126 | Return an array with the elements converted to lowercase. |
| 1127 | |
| 1128 | Call :meth:`str.lower` element-wise. |
| 1129 | |
| 1130 | For 8-bit strings, this method is locale-dependent. |
| 1131 | |
| 1132 | Parameters |
| 1133 | ---------- |
| 1134 | a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype |
| 1135 | Input array. |
| 1136 | |
| 1137 | Returns |
| 1138 | ------- |
| 1139 | out : ndarray |
| 1140 | Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype, |
| 1141 | depending on input types |
| 1142 | |
| 1143 | See Also |
| 1144 | -------- |
| 1145 | str.lower |
| 1146 | |
| 1147 | Examples |
| 1148 | -------- |
| 1149 | >>> import numpy as np |
| 1150 | >>> c = np.array(['A1B C', '1BCA', 'BCA1']); c |
| 1151 | array(['A1B C', '1BCA', 'BCA1'], dtype='<U5') |
| 1152 | >>> np.strings.lower(c) |
| 1153 | array(['a1b c', '1bca', 'bca1'], dtype='<U5') |
| 1154 | |
| 1155 | """ |
| 1156 | a_arr = np.asarray(a) |
| 1157 | return _vec_string(a_arr, a_arr.dtype, 'lower') |
| 1158 | |
| 1159 | |
| 1160 | @set_module("numpy.strings") |
no outgoing calls
no test coverage detected
searching dependent graphs…