changeset 109:fae24f57dcb1

streamlining
author Jeff Hammel <k0scist@gmail.com>
date Sun, 15 Mar 2015 10:49:29 -0700
parents bad50c6bb243
children 5790bcb30bd8
files numerics/convert.py
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/numerics/convert.py	Sun Mar 15 10:12:33 2015 -0700
+++ b/numerics/convert.py	Sun Mar 15 10:49:29 2015 -0700
@@ -61,7 +61,8 @@
     """
     cast a column of data
     """
-    column_types = [column_type(column) for column in columns]
+    column_types = [column_type(column, types=types)
+                    for column in columns]
     return [[column_type(row) for row in column]
             for column_type, column in zip(column_types, columns)]
 
@@ -73,11 +74,8 @@
     parser = CSVParser(description="interpolate types from file")
     options = parser.parse_args(args)
 
-    # read CSV file
-    data = parser.read()
-
-    # transpose
-    columns = transpose(data)
+    # read CSV file columns
+    columns = parser.columns()
 
     # get types
     types = [column_type(column) for column in columns]