code: def _trim_zeros(str_floats, na_rep='NaN'):
      
      trimmed = str_floats
  
      def _cond(values):
          non_na = [x for x in values if x != na_rep]
          return (len(non_na) > 0 and all([x.endswith('0') for x in non_na]) and
                  not(any([('e' in x) or ('E' in x) for x in non_na])))
  
      while _cond(trimmed):
          trimmed = [x[:-1] if x != na_rep else x for x in trimmed]
  
      # trim decimal points
      return [x[:-1] if x.endswith('.') and x != na_rep else x for x in trimmed]
docs: Trims zeros and decimal points.