numpy.strings.lower#

strings.lower(a)[source]#

傳回一個陣列,其中的元素已轉換為小寫。

逐元素呼叫 str.lower

對於 8 位元字串,此方法與地區設定相關。

參數:
a類陣列 (array-like),具有 StringDTypebytes_str_ dtype

輸入陣列。

傳回值:
outndarray

輸出陣列,其 dtype 為 StringDTypebytes_str_,取決於輸入類型

另請參閱

str.lower

範例

>>> import numpy as np
>>> c = np.array(['A1B C', '1BCA', 'BCA1']); c
array(['A1B C', '1BCA', 'BCA1'], dtype='<U5')
>>> np.strings.lower(c)
array(['a1b c', '1bca', 'bca1'], dtype='<U5')