Q:

Write a NumPy program to split the element of a given array to multiple lines

0

Write a NumPy program to split the element of a given array to multiple lines.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
x = np.array(['Python\Exercises, Practice, Solution'], dtype=np.str)
print("Original Array:")
print(x)
r = np.char.splitlines(x)
print(r)

Sample Input:

['Python\\Exercises, Practice, Solution']

Sample Input:

(['Python\Exercises, Practice, Solution'], dtype=np.str)

Sample Output:

[list(['Python\\Exercises, Practice, Solution'])]

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now