numpy.strings.capitalize#
- strings.capitalize(a)[source]#
Return a copy of
a
with only the first character of each element capitalized.Calls
str.capitalize
element-wise.For byte strings, this method is locale-dependent.
- Parameters:
- aarray-like, with
StringDType
,bytes_
, orstr_
dtype Input array of strings to capitalize.
- aarray-like, with
- Returns:
- outndarray
Output array of
StringDType
,bytes_
orstr_
dtype, depending on input types
See also