On 18-02-11 09:42, lim chee siong wrote:
>
>
> Hi,
>
> I was writing a module for the black-scholes pricing model in python,
> but I keep getting this error message:
>
> Traceback (most recent call last):
> File "", line 1, in
> File "C:\Python26\lib\blackscholes.py", line 25
> d2=d1-v*sqrt(t)
Tha
Hi,
I was writing a module for the black-scholes pricing model in python, but I
keep getting this error message:
Traceback (most recent call last): File "", line 1, in File
"C:\Python26\lib\blackscholes.py", line 25d2=d1-v*sqrt(t)
This is the code in my blackscholes.py file:#Black
I noticed some odd behavior relating to eval(). First, a baseline case for
behavior:
>>> def test():
... x = 5
... return [a for a in range(10) if a == x]
...
>>> test()
[5]
So far so good. Now let's try eval:
>>> c = compile('[a for a in range(10) if a == x]', '', 'single')
>>> eval(c, globals(
Hi Steven,
Thanks a BUNCH for helping me! Yes, you were correct in assuming that my input
data are already names. They're names in a column in a csv file. They're the
names of GPs, in various formats. Besides the forms I've mentioned already
there
are examples such as 'Doctor's office Duh, J.
lim chee siong wrote:
>
>
> Hi,
> I was writing a module for the black-scholes pricing model in python, but I
> keep getting this error message:
> Traceback (most recent call last): File "", line 1, in File
> "C:\Python26\lib\blackscholes.py", line 25d2=d1-v*sqrt(t)
Please COPY A
Albert-Jan Roskam wrote:
So the raw string \b means means "ASCII backspace". Is that another way of
saying that it means 'Word boundary'?
No.
Python string literals use backslash escapes for special characters,
similar to what many other computer languages, including C, do.
So when you typ
John wrote:
> I noticed some odd behavior relating to eval(). First, a baseline case for
> behavior:
>
def test():
> ... x = 5
> ... return [a for a in range(10) if a == x]
> ...
test()
> [5]
>
> So far so good. Now let's try eval:
>
c = compile('[a for a in range(10) if a == x]'
There's a few things I've noticed:
1. I would recommend using an IDE of some sort. I copy and pasted this into
eclipse, and it told me straight away that you had a parenthesis problem on
this line: d1=(log(s/x)+((r+v**2/2)*t)/(v*sqrt(t))
2. Your function "dividend" isn't returning a value.
3. Un