In this chapter, we will discuss about NumPy char replace. This function returns a new copy of the input string in which all occurrences of the sequence of characters is replaced by another given sequence.
import numpy as np print np.char.replace ('He is a good boy', 'is', 'was')
Its output is as follows −
He was a good boy
Next Topic – Click Here
Pingback: NumPy char join - Adglob Infosystem Pvt Ltd .........
Pingback: NumPy - String Functions - Adglob Infosystem Pvt Ltd