def str_strip(arr, to_strip=None, side='both'):
 if (side == 'both'):
  f = (lambda x: x.strip(to_strip))
 elif (side == 'left'):
  f = (lambda x: x.lstrip(to_strip))
 elif (side == 'right'):
  f = (lambda x: x.rstrip(to_strip))
 else:
  raise ValueError('Invalid side')
 return _na_map(f, arr)

def str_strip ( arr , to_strip = None , side = 'both' ) : if ( side == 'both' ) : f = ( lambda x : x . strip ( to_strip ) ) elif ( side == 'left' ) : f = ( lambda x : x . lstrip ( to_strip ) ) elif ( side == 'right' ) : f = ( lambda x : x . rstrip ( to_strip ) ) else : raise ValueError ( 'Invalid side' ) return _na_map ( f , arr )
strip whitespace from each string in the series/index .