Answers for "python split string to array"

26

how to split a string by character in python

def split(word): 
    return [char for char in word]  
      
# Driver code 
word = 'geeks'
print(split(word)) 

#Output ['g', 'e', 'e', 'k', 's']
Posted by: Guest on December-07-2019
0

python split array

>>> x = np.arange(9.0)
>>> np.split(x, 3)
[array([0.,  1.,  2.]), array([3.,  4.,  5.]), array([6.,  7.,  8.])]
Posted by: Guest on June-01-2021

Code answers related to "python split string to array"

Python Answers by Framework

Browse Popular Code Answers by Language