Revert weird bad .time access

its_happening
Tyler Goodlet 2020-06-17 22:58:54 -04:00
parent 9a397c54ac
commit bae7ea1ac1
2 changed files with 3 additions and 5 deletions

View File

@ -60,8 +60,8 @@ def from_df(
df: pd.DataFrame,
source=None,
default_tf=None
):
"""Cast OHLC ``pandas.DataFrame`` to ``numpy.structarray``.
) -> np.recarray:
"""Convert OHLC formatted ``pandas.DataFrame`` to ``numpy.recarray``.
"""
df.reset_index(inplace=True)
df['Date'] = [d.timestamp() for d in df.Date]
@ -79,10 +79,8 @@ def from_df(
if name not in columns:
del df[name]
df = df.rename(columns=columns)
# df.insert(0, 'id', df.index)
array = df.to_records()
_nan_to_closest_num(array)
# self._set_time_frame(default_tf)
return array

View File

@ -90,7 +90,7 @@ class BaseQuotes(np.recarray):
def convert_dates(self, dates):
breakpoint()
return np.array([d.timestamp().time for d in dates])
return np.array([d.timestamp() for d in dates])
class SymbolType(Enum):