Mercurial > hg > numerics
comparison 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 |
comparison
equal
deleted
inserted
replaced
4:097296d6132e | 5:d5447d401c44 |
---|---|
1 def cast(to_type, *values): | |
2 retval = [] | |
3 for value in values: | |
4 try: | |
5 retval.append(to_type(value)) | |
6 except ValueError: | |
7 retval.append(value) | |
8 return retval | |
9 | |
10 def float_or_orig(*values): | |
11 return cast(float, *values) |