numpy.char.split()


Advertisements

This function returns a list of words in the input string. By default, a whitespace is used as a separator. Otherwise the specified separator character is used to spilt the string.

import numpy as np 
print np.char.split ('hello how are you?') 
print np.char.split ('TutorialsPoint,Hyderabad,Telangana', sep = ',')

Its output would be −

['hello', 'how', 'are', 'you?']
['TutorialsPoint', 'Hyderabad', 'Telangana']
numpy_string_functions.htm
Advertisements