In this chapter, we will discuss about NumPy char splitlines. This function returns a list of elements in the array, breaking at line boundaries.
import numpy as np print np.char.splitlines('hello\nhow are you?') print np.char.splitlines('hello\rhow are you?')
Its output is as follows −
['hello', 'how are you?'] ['hello', 'how are you?']
‘\n’, ‘\r’, ‘\r\n’ can be used as line boundaries.
Next Topic – Click Here
Pingback: NumPy char split - Adglob Infosystem Pvt Ltd .........
Pingback: NumPy String Functions - Adglob Infosystem Pvt Ltd