Steve L. Nyemba 4 years ago
parent 73115724fe
commit 856d1e4bd7

@ -218,17 +218,18 @@ class Components :
# df = args['data'] # df = args['data']
_cast = {} _cast = {}
if schema : if schema :
for _item in schem :
dtype = str dtype = str
name = schema['name'] name = _item['name']
novalue = -1 novalue = -1
if schema['type'] == 'INTEGER' : if _item['type'] == 'INTEGER' :
dtype = np.int64 dtype = np.int64
elif schema['type'] == 'FLOAT' : elif _item['type'] == 'FLOAT' :
dtype = np.float64 dtype = np.float64
else: else:
novalue = '' novalue = ''
_cast[schema['name']] = dtype # _cast[schema['name']] = dtype
df[name] = df[name].fillna(novalue).astype(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} _info = {"module":"gan-prep","action":"read","shape":{"rows":df.shape[0],"columns":df.shape[1]},"schema":schema}

Loading…
Cancel
Save