Mercurial > hg > numerics
view numerics/convert.py @ 5:d5447d401c44
serializaion; pandas probably does this
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Thu, 04 Sep 2014 18:00:04 -0700 |
parents | |
children | 7761aa18e885 |
line wrap: on
line source
def cast(to_type, *values): retval = [] for value in values: try: retval.append(to_type(value)) except ValueError: retval.append(value) return retval def float_or_orig(*values): return cast(float, *values)