Open In App

lower() function - NumPy

Last Updated : 27 Sep, 2025
Suggest changes
Share
Like Article
Like
Report

The numpy.char.lower() function is used to convert all uppercase characters in a string array into lowercase. This is helpful when normalizing text data for comparison, preprocessing or analysis.

This example shows how to convert an array into lowercase using numpy.char.lower().

Python
import numpy as np
arr = np.array(['HELLO', 'WORLD'])
res = np.char.lower(arr)
print(res)

Output
['hello' 'world']

Syntax

numpy.char.lower(arr)
  • Parameters: arr (array_like) -> Input array of strings.
  • Return Value: ndarray -> Array with all elements converted to lowercase.

Examples

Example 1: This example converts a string array containing both letters and numbers into lowercase.

Python
import numpy as np
arr = np.array(['P4Q R', '4Q RP', 'Q RP4', 'RP4Q'])
res = np.char.lower(arr)
print("Array:", arr)
print("Result:", res)

Output
Array: ['P4Q R' '4Q RP' 'Q RP4' 'RP4Q']
Result: ['p4q r' '4q rp' 'q rp4' 'rp4q']

Example 2: This example converts an array of uppercase words into lowercase.

Python
import numpy as np
arr = np.array(['GEEKS', 'FOR', 'GEEKS'])
res = np.char.lower(arr)
print("Array:", arr)
print("Result:", res)

Output
Array: ['GEEKS' 'FOR' 'GEEKS']
Result: ['geeks' 'for' 'geeks']

Example 3: This example converts an array containing mixed-case names into lowercase.

Python
import numpy as np
arr = np.array(['EMILY', 'JENNIFER', 'HARRY'])
res = np.char.lower(arr)
print("Array:", arr)
print("Result:", res)

Output
Array: ['EMILY' 'JENNIFER' 'HARRY']
Result: ['emily' 'jennifer' 'harry']

Explore