def str_translate(arr, table, deletechars=None):
 if (deletechars is None):
  f = (lambda x: x.translate(table))
 else:
  from pandas import compat
  if compat.PY3:
   raise ValueError('deletechars is not a valid argument for str.translate in python 3. You should simply specify character deletions in the table argument')
  f = (lambda x: x.translate(table, deletechars))
 return _na_map(f, arr)

def str_translate ( arr , table , deletechars = None ) : if ( deletechars is None ) : f = ( lambda x : x . translate ( table ) ) else : from pandas import compat if compat . PY3 : raise ValueError ( 'deletechars is not a valid argument for str.translate in python 3. You should simply specify character deletions in the table argument' ) f = ( lambda x : x . translate ( table , deletechars ) ) return _na_map ( f , arr )
map all characters in the string through the given mapping table .