def _rstrip_inplace(array, chars=None):
 for item in np.nditer(array, flags=['zerosize_ok'], op_flags=['readwrite']):
  item[...] = item.item().rstrip(chars)

def _rstrip_inplace ( array , chars = None ) : for item in np . nditer ( array , flags = [ 'zerosize_ok' ] , op_flags = [ 'readwrite' ] ) : item [ ... ] = item . item ( ) . rstrip ( chars )
performs an in-place rstrip operation on string arrays .