bug fixes data format

This commit is contained in:
Steve Nyemba 2022-05-16 13:59:58 -05:00
parent 42ccca5f8d
commit 1d0bbce748
1 changed files with 3 additions and 1 deletions

View File

@ -287,13 +287,15 @@ class Generator (Learner):
#-- Sometimes data isn't all it's meant to be
if 'format' in self.info and name in self.info['format'] :
FORMAT = self.info['format'][name]
SIZE = 10
elif _item['type'] in ['DATETIME','TIMESTAMP'] :
FORMAT = '%Y-%m-%d %H:%M:%S'
SIZE = 19
r[name] = FORMAT
_df[name] = pd.to_datetime(_df[name], format=FORMAT) #.astype('datetime64[ns]')
if _item['type'] in ['DATETIME','TIMESTAMP']:
_df[name] = _df[name].fillna('').astype('datetime64[ns]')
pass #;_df[name] = _df[name].fillna('').astype('datetime64[ns]')
else:
_df[name] = _df[name].astype(str)
except Exception as e: