FinancePy
FinancePy copied to clipboard
Vectorisation of Calculations
Some functions take a date as an input. However I would like to be able to pass in a vector/list of dates and/or a vector of enums and get a corresponding vector of values.
This is shown in notebook
https://github.com/domokane/FinancePy/blob/master/notebooks/products/equity/EQUITY_VANILLA_EUROPEAN_STYLE_OPTION_VECTORISATION.ipynb
Consider f(x,y,z). Behaviour that would be good
- If x is an N-element vector and y, z not then f(x,y,z) is an N-element vector for each value of x
- If x is an N-element vector and y is an N element vector but z is not then f(x,y,z) is an N-element vector for each value of x,y
- If x, y, z are all an N-element vector then f(x,y,z) is an N-element vector for each value of x,y
A generic approach would be best that is easy to modify and relies on a central function that takes as argument the function to be called.
I'll take this up.
Great!
#49 - Enum Support
Hi, looks like the list of dates part of this was never implemented. I'm happy to do it if no one else is
Hi - I have not looked at this for a while. Please look into it and if you have a good solution then I would be happy if you could do it. Ideally it should be a solution that can be applied to many functions with minimum changes. So a helper function or other approach will be needed. Best D