|
|
@ -263,6 +263,7 @@ class Generator (Learner):
|
|
|
|
|
|
|
|
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
def format(self,_df,_schema):
|
|
|
|
def format(self,_df,_schema):
|
|
|
|
|
|
|
|
r = {}
|
|
|
|
for _item in _schema :
|
|
|
|
for _item in _schema :
|
|
|
|
name = _item['name']
|
|
|
|
name = _item['name']
|
|
|
|
|
|
|
|
|
|
|
@ -273,9 +274,12 @@ class Generator (Learner):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
if _item['type'] == ['DATETIME','TIMESTAMP'] :
|
|
|
|
if _item['type'] == ['DATETIME','TIMESTAMP'] :
|
|
|
|
FORMAT = '%Y-%d-%m %H:%M:%S'
|
|
|
|
FORMAT = '%Y-%d-%m %H:%M:%S'
|
|
|
|
self.log(**{'action':'format','input':{'name':name,'format':FORMAT}})
|
|
|
|
r[name] = FORMAT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_df[name] = pd.to_datetime(_df[name], format=FORMAT).astype(str) #.astype('datetime64[ns]')
|
|
|
|
_df[name] = pd.to_datetime(_df[name], format=FORMAT).astype(str) #.astype('datetime64[ns]')
|
|
|
|
|
|
|
|
if r :
|
|
|
|
|
|
|
|
self.log(**{'action':'format','input':r})
|
|
|
|
return _df
|
|
|
|
return _df
|
|
|
|
|
|
|
|
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|