code: def strip_columns(tab):
      
      for colname in tab.colnames:
          if tab[colname].dtype.kind in ['S', 'U']:
              tab[colname] = np.core.defchararray.strip(tab[colname])
docs: Strip whitespace from string columns.