Skip to content

Commit

Permalink
MyFuncs.py with Bruno's testing code for future reference
Browse files Browse the repository at this point in the history
  • Loading branch information
brunopereiracosta committed Nov 21, 2018
1 parent eed1714 commit 99ffcef
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion MyFuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,24 @@ def date_to_yearday(sheet):
return [(date-datetime.datetime(year=date.year,month=1,day=1)).days for date in sheet['Date'].tolist()]

def read_sheet(sheet):
return sheet['Last Price'].tolist(), date_to_yearday(sheet), date_to_weekday(sheet)
return sheet['Last Price'].tolist(), date_to_yearday(sheet), date_to_weekday(sheet)

# bruno testing
import pandas as pd
import time
# clock
start = time.time()
xls = pd.ExcelFile('./SECRET ADMIRER.xlsx')
end = time.time()
elapsed = end - start
print(elapsed)

USDEUR = xls.parse(xls.sheet_names.index('EURUSD BGN'))

a = date_to_weekday(USDEUR)
b = date_to_yearday(USDEUR)
c = read_sheet(USDEUR)

print(a[0])
print(b[0])
print(c[1][0])

0 comments on commit 99ffcef

Please sign in to comment.