Git Product home page Git Product logo

Comments (7)

erykml avatar erykml commented on June 24, 2024

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.

randommarko avatar randommarko commented on June 24, 2024

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.

randommarko avatar randommarko commented on June 24, 2024

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.

erykml avatar erykml commented on June 24, 2024

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.

randommarko avatar randommarko commented on June 24, 2024

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.

erykml avatar erykml commented on June 24, 2024

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.

randommarko avatar randommarko commented on June 24, 2024

many thanks again eryk! 👍

from python-for-finance-cookbook.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.