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