numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
capitalize(a)

Calls :None:None:`str.capitalize` element-wise.

For 8-bit strings, this method is locale-dependent.

Parameters

a : array_like of str or unicode

Input array of strings to capitalize.

Returns

out : ndarray

Output array of str or unicode, depending on input types

Return a copy of a with only the first character of each element capitalized.

See Also

str.capitalize

Examples

>>> c = np.array(['a1b2','1b2a','b2a1','2a1b'],'S4'); c
array(['a1b2', '1b2a', 'b2a1', '2a1b'],
    dtype='|S4')
>>> np.char.capitalize(c)
array(['A1b2', '1b2a', 'B2a1', '2a1b'],
    dtype='|S4')
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.core.defchararray.chararray.capitalize

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/core/defchararray.py#379
type: <class 'function'>
Commit: