bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / strings / swapcase
_ArrayFunctionDispatcher
numpy.strings:swapcase
source: build-install/usr/lib/python3.14/site-packages/numpy/_core/strings.py :1160
Signature
def swapcase ( a ) Summary
Return element-wise a copy of the string with uppercase characters converted to lowercase and vice versa.
Extended Summary
Calls str.swapcase element-wise.
For 8-bit strings, this method is locale-dependent.
Parameters
a: array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtypeInput array.
Returns
out: ndarrayOutput array of
StringDType,bytes_orstr_dtype, depending on input types
Examples
import numpy as np
✓c=np.array(['a1B c','1b Ca','b Ca1','cA1b'],'S5'); c np.strings.swapcase(c)✗
See also
- str.swapcase
Aliases
-
numpy.char.swapcase