numpy string operations | join() function
numpy.core.defchararray.join(sep, arr) is another function for doing string operations in numpy. For each element in arr, it returns a copy of the string in which the string elements of array have been joined by separator.
sep : It joins elements with the string between them.
arr :Input array.
Returns : Output array of str or unicode with joined elements.
Code #1 :
Input original array : ['Python' 'Numpy' 'Pandas'] Output joined array: ['P-y-t-h-o-n' 'N+u+m+p+y' 'P*a*n*d*a*s']
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course