Mercurial > hg > numerics
comparison numerics/manipulate.py @ 125:d255058333b2
putzing
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Mon, 16 Mar 2015 19:31:49 -0700 |
parents | c4d26ef63d8e |
children | 12649a88545c |
comparison
equal
deleted
inserted
replaced
124:84baf80a5202 | 125:d255058333b2 |
---|---|
12 from .convert import default_cast, cast_columns | 12 from .convert import default_cast, cast_columns |
13 from .data import transpose | 13 from .data import transpose |
14 from .read import CSVParser | 14 from .read import CSVParser |
15 | 15 |
16 # module globals | 16 # module globals |
17 __all__ = ['ManipulationParser', 'main'] | 17 __all__ = ['ManipulationParser', 'FloatParser', 'main'] |
18 | 18 |
19 | 19 |
20 class ManipulationParser(CSVParser): | 20 class ManipulationParser(CSVParser): |
21 """CLI option parser for data manipulation""" | 21 """CLI option parser for data manipulation""" |
22 | 22 |
33 | 33 |
34 def process(self): | 34 def process(self): |
35 return transpose(self.typed_data()) | 35 return transpose(self.typed_data()) |
36 | 36 |
37 | 37 |
38 class FloatParser(ManipulationParser): | |
39 """manipulation parser convenience just for floats""" | |
40 types = (float,) | |
41 | |
42 | |
38 def main(args=sys.argv[1:]): | 43 def main(args=sys.argv[1:]): |
39 """CLI""" | 44 """CLI""" |
40 | 45 |
41 # parse command line options | 46 # parse command line options |
42 parser = ManipulationParser() | 47 parser = ManipulationParser() |