NumPy 字符串函数 numpy.char.upper() 此函数在数组中的每个元素上调用 str.upper 函数,以返回大写的数组元素。 import numpy as np print np.char.upper('hello') print np.char.upper(['hello','world']) PythonCopy 这是它的输出 – HELLO ['HELLO' 'WORLD'] PythonCopy