NumPy numpy.char.splitlines() 函数
-
简述
此函数返回数组中的元素列表,在行边界处中断。import numpy as np print np.char.splitlines('hello\nhow are you?') print np.char.splitlines('hello\rhow are you?')
它的输出如下 -['hello', 'how are you?'] ['hello', 'how are you?']
'\n', '\r', '\r\n' 可以用作行边界。