Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 19 19.3 In[95] #13

Open
ghost opened this issue Jun 25, 2022 · 3 comments
Open

Chapter 19 19.3 In[95] #13

ghost opened this issue Jun 25, 2022 · 3 comments

Comments

@ghost
Copy link

ghost commented Jun 25, 2022

I have a question related to American Put Option Analysis by using the valuation_mcs_american.py and the code given in Chapter 19 Section 19.3:
For In[95]: for maturity in (dt.datetime(2020, 12, 31), dt.datetime(2021, 12, 31):
When I type this and after finish the whole In[95]: It reported an error of saying: Only size-1 arrays can be converted to Python scalars
However, if I only designate: maturity=dt.datetime(2020, 12, 31), there is no error happening again
I would like to know what could have happened and if there are some further guidelines, please let me know, thanks

Repository owner deleted a comment from JadeChan3 Jun 26, 2022
@yhilpisch
Copy link
Owner

Can you please post a complete example that reproduces your problem.

How to create a Minimal, Complete, and Verifiable example
https://stackoverflow.com/help/mcve

@ghost
Copy link
Author

ghost commented Jun 26, 2022

@yhilpisch
The example is given on the book Python For Finance 2nd Edition Chapter 19: A Use Case and I create a jupyter notebook by typing the code completely following the code given on the book
Problem
When I follow the code and type In[95] (My In[] number is not 95 because I start this Chapter's code with a completely new start not continuing on the Chapter 18's code, but making sure that the code before In[95] has been carried out correctly:
Here is the error:
Error

I don't know how I could correct this error and I wonder whether there is something wrong with my code or something else.

@yhilpisch
Copy link
Owner

Such screenshots are not really helpful. How shall I possibly replicate your problem?

Please post a complete (!), minimal code example that I can copy and use to replicate your error.

@ghost ghost closed this as completed Jun 27, 2022
@ghost ghost reopened this Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant