From 856d1e4bd7650b74f07f047f193777766dd1b947 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Sun, 4 Apr 2021 12:09:34 -0500 Subject: [PATCH] ... --- pipeline.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/pipeline.py b/pipeline.py index da7b27e..1ca19e5 100644 --- a/pipeline.py +++ b/pipeline.py @@ -218,18 +218,19 @@ class Components : # df = args['data'] _cast = {} if schema : - dtype = str - name = schema['name'] - novalue = -1 - if schema['type'] == 'INTEGER' : - dtype = np.int64 - - elif schema['type'] == 'FLOAT' : - dtype = np.float64 - else: - novalue = '' - _cast[schema['name']] = dtype - df[name] = df[name].fillna(novalue).astype(dtype) + for _item in schem : + dtype = str + name = _item['name'] + novalue = -1 + if _item['type'] == 'INTEGER' : + dtype = np.int64 + + elif _item['type'] == 'FLOAT' : + dtype = np.float64 + else: + novalue = '' + # _cast[schema['name']] = dtype + df[name] = df[name].fillna(novalue).astype(dtype) _info = {"module":"gan-prep","action":"read","shape":{"rows":df.shape[0],"columns":df.shape[1]},"schema":schema} logger.write(_info)