chevron_left
Char
Method addMethod capitalizeMethod centerMethod countMethod endswithMethod equalMethod expandtabsMethod findMethod greaterMethod greater_equalMethod indexMethod isalnumMethod isalphaMethod isdecimalMethod isdigitMethod isnumericMethod isupperMethod joinMethod lessMethod less_equalMethod ljustMethod lowerMethod multiplyMethod not_equalMethod rfindMethod rjustMethod rstripMethod splitMethod splitlinesMethod startswithMethod upperMethod zfill
check_circle
Mark as learned thumb_up
0
thumb_down
0
chat_bubble_outline
0
auto_stories new
settings
Method char | capitalize method
NumPy
chevron_rightDocumentation
chevron_rightChar
schedule Jul 1, 2022
Last updated local_offer Python●NumPy
Tags tocTable of Contents
expand_more Check out the interactive map of data science
Numpy's capitalize(~)
method turns the first character of each input string to uppercase, and the all rest to lowercase (e.g. Hello world).
Parameters
1. a
| array-like
The input array.
Return value
A Numpy array.
Examples
np.char.capitalize(["hello world"])
array(['Hello world'], dtype='<U11')
Published by Isshin Inada
Edited by 0 others
Did you find this page useful?
thumb_up
thumb_down
Ask a question or leave a feedback...
Official NumPy Documentation
https://numpy.org/doc/stable/reference/generated/numpy.char.capitalize.html
thumb_up
0
thumb_down
0
chat_bubble_outline
0
settings
Enjoy our search
Hit / to insta-search docs and recipes!