def _tidyup_labels(self, labels):
def remove_zeroes(s):<EOL><INDENT>"""<STR_LIT>"""<EOL>tup = s.split('<STR_LIT:e>')<EOL>if len(tup) == <NUM_LIT:2>:<EOL><INDENT>mantissa = tup[<NUM_LIT:0>].rstrip('<STR_LIT:0>').rstrip('<STR_LIT:.>')<EOL>exponent = int(tup[<NUM_LIT:1>])<EOL>if exponent:<EOL><INDENT>s = '<STR_LIT>' % (mantissa, exponent)<EOL><DEDENT>else:<EOL><INDENT>s = mantissa<EOL><DEDENT><DEDENT>return s<EOL><DEDENT>def as_exp(s):<EOL><INDENT>"""<STR_LIT>"""<EOL>return s if '<STR_LIT:e>' in s else '<STR_LIT>'.format(float(s))<EOL><DEDENT>has_e = np.array(['<STR_LIT:e>' in x for x in labels])<EOL>if not np.all(has_e) and not np.all(~has_e):<EOL><INDENT>labels = [as_exp(x) for x in labels]<EOL><DEDENT>labels = [remove_zeroes(x) for x in labels]<EOL>return labels<EOL>
Make all labels uniform in format and remove redundant zeros
for labels in exponential format.

Parameters
----------
labels : list-like
    Labels to be tidied.

Returns
-------
out : list-like
    Labels