Skip to content

Commit

Permalink
Merge pull request #20 from alan-turing-institute/bugfix/aapl
Browse files Browse the repository at this point in the history
Minor bugfixes for apple dataset
  • Loading branch information
GjjvdBurg authored Oct 21, 2024
2 parents 7e42362 + 120bedc commit c1a70fa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions datasets/apple/get_apple.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def get_aapl():
)

# Get the actual date range we want
aapl = aapl[date_start:date_end]
aapl = aapl.loc[date_start:date_end]
aapl = aapl.copy()

# Drop the timezone information
Expand All @@ -104,8 +104,8 @@ def get_aapl():
# we correct this change here by using a hard-coded closing price.
# This ensures that the resulting dataset has the same values as
# used in the TCPDBench paper.
if (0.2131696 <= aapl["Close"][0] <= 0.2131697) or (
0.21317000 <= aapl["Close"][0] <= 0.21317001
if (0.2131696 <= aapl["Close"].values[0, 0] <= 0.2131697) or (
0.21317000 <= aapl["Close"].values[0, 0] <= 0.21317001
):
aapl["Open"] = aapl["Open"] * 4
aapl["High"] = aapl["High"] * 4
Expand All @@ -114,6 +114,9 @@ def get_aapl():
# Adj Close doesn't adhere to factor 4
aapl["Volume"] = aapl["Volume"] // 4

if aapl.columns.nlevels > 1:
aapl.columns = aapl.columns.droplevel(1)

return aapl


Expand Down

0 comments on commit c1a70fa

Please sign in to comment.