Comments (7)
Hi, are you encountering the error while executing the code from the Notebook in this repo or after some changes done by yourself? This will already be helpful with potential debugging :) Cheers
from python-for-finance-cookbook.
Many thanks for getting back! I simply copied the code into a Jupyter Notebook. Since the code & result seem to work leaving the ".date()" component out, I do not want you to bother with the issue I raised. Since I would like to use it in a business (Risk Management) context, I wanna make sure I do not ignore a vital part of the code. Do you think I can just proceed without the ".date()" part? Thanks again
from python-for-finance-cookbook.
If relevant: One thing I noticed that the error message "KeyError: datetime.date(2019, 6, 28)" relates to the last trading day in "train" period.
from python-for-finance-cookbook.
Hi @randommarko,
indeed it seems that due to changing the date to datetime.date
it is no longer compatible with this method of selecting values. The reason it works without .date()
is that then the data is retained in the pandas
timestamp format. I removed the unnecessary conversion from the code, you can just pull the new version or remove it manually. Otherwise, the code works well and you can definitely use it for your needs :) Hope this helps!
If this solves the issue, please close it :)
from python-for-finance-cookbook.
Many thanks for the fast reply! Defo resolved, thanks for clarifying. May I ask you a follow up question on Monte Carlo? Do you happen to know of an easy way in Python to define a percentile? Say of 100 similations, id like the 95th simulation on the downside, similar as a Value at Risk. Thanks again for your time.
from python-for-finance-cookbook.
No worries :) I believe it's covered in a later part of the book. You can either sort the values and the x-th or use numpy. Cheers!
from python-for-finance-cookbook.
many thanks again eryk! 👍
from python-for-finance-cookbook.
Related Issues (14)
- Code for Chapter 2 SMA-Signal results in error [ERRNO] No such file or Directory; 'APPL' HOT 3
- Chapter 7.2 While plotting the "Efficient Frontier" facing IndexError: list index out of range HOT 2
- Finance Cookbook
- Python for finance HOT 2
- Chapter 01 Not defined error HOT 2
- File not found error
- Code for Chapter 2 iplot graph does not fill in. HOT 4
- Chapter 2 Plot error HOT 2
- 'unzip' and 'rm' are not recognized commands HOT 1
- cufflinks go offline HOT 2
- issue generating images/ch6_im2.png (Geometric Brownian Motion) HOT 6
- qf.iplot() is Blank in Colab HOT 1
- performance_evaluation_report(learn) wont' run HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-for-finance-cookbook.