revised dataloader
This commit is contained in:
parent
c608d73f07
commit
aaee1a9fcf
@ -8,9 +8,13 @@ class DukaMTInterface:
|
|||||||
has two attributes -- bids and asks
|
has two attributes -- bids and asks
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, duka_candlesticks_filepath):
|
def __init__(self, duka_candlesticks):
|
||||||
# reading index from column 0 and header takes two rows, because of multirow indexers
|
# checking if provided is path or pandas dataframe
|
||||||
self.duka_dataset = pd.read_csv(duka_candlesticks_filepath, index_col=0, header=[0, 1], parse_dates=True)
|
if isinstance(duka_candlesticks, pd.DataFrame):
|
||||||
|
self.duka_dataset = duka_candlesticks
|
||||||
|
else:
|
||||||
|
# reading index from column 0 and header takes two rows, because of multirow indexers
|
||||||
|
self.duka_dataset = pd.read_csv(duka_candlesticks, index_col=0, header=[0, 1], parse_dates=True)
|
||||||
|
|
||||||
# renaming timestamp to date
|
# renaming timestamp to date
|
||||||
self.duka_dataset['date'] = self.duka_dataset.index
|
self.duka_dataset['date'] = self.duka_dataset.index
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user