NumPy char strip

NumPy char strip

In this chapter, we will discuss about NumPy char strip. This function returns a copy of array with elements stripped of the specified characters leading and/or trailing in it.

import numpy as np 
print np.char.strip('ashok arora','a') 
print np.char.strip(['arora','admin','java'],'a')

Here is its output −

shok aror
['ror' 'dmin' 'jav']

Next Topic – Click Here

This Post Has 2 Comments

Leave a Reply