Revert weird bad .time access
parent
9a397c54ac
commit
bae7ea1ac1
|
@ -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
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue