Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

handler.py 724 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  1. import datetime as dt
  2. import yfinance as yf
  3. import dagshub
  4. import mlflow
  5. def get_experiment_id(name):
  6. exp = mlflow.get_experiment_by_name(name)
  7. if exp is None:
  8. exp_id = mlflow.create_experiment(name)
  9. return exp_id
  10. return exp.experiment_id
  11. def load_data():
  12. Stock_Number= "BTC-USD"
  13. End_date = "2022-02-08"
  14. Period = 5
  15. Interval = 1
  16. enddate = dt.datetime.strptime(End_date, "%Y-%m-%d").date()
  17. startdate = enddate - dt.timedelta(days=365 * Period) # for 5 years
  18. data = yf.download(tickers=Stock_Number, start=startdate, end=enddate, interval=f"{Interval}d")
  19. return data
  20. if __name__ == "__main__":
  21. pass
  22. # data = load_data()
  23. # dagshub.auth.get_token()
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...