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

Name norm is not defined using python 3.9 version #13

Open
akashiitd opened this issue Mar 12, 2022 · 3 comments
Open

Name norm is not defined using python 3.9 version #13

akashiitd opened this issue Mar 12, 2022 · 3 comments

Comments

@akashiitd
Copy link

``[self.callPrice, self.putPrice] = self._price()
277 else:
--> 278 [self.callPrice, self.putPrice] = self._price()
279 [self.callDelta, self.putDelta] = self._delta()
280 [self.callDelta2, self.putDelta2] = self._delta2()

File c:\program files\python39\lib\site-packages\mibian_init_.py:307, in BS._price(self)
305 raise ZeroDivisionError('The strike price cannot be zero')
306 else:
--> 307 call = self.underlyingPrice * norm.cdf(self.d1) -
308 self.strikePrice * e**(-self.interestRate *
309 self.daysToExpiration) * norm.cdf(self.d2)
310 put = self.strikePrice * e**(-self.interestRate *
311 self.daysToExpiration) * norm.cdf(-self.d2) -
312 self.underlyingPrice * norm.cdf(-self.d1)
313 return [call, put]

NameError: name 'norm' is not defined

@sidnet033
Copy link

i am getting the same error. what is the solution?

@anurag199831
Copy link

anurag199831 commented Feb 17, 2024

pip install scipy, then using from scipy.stats import norm in my code solved it for me.

@apmcodes
Copy link

The above did not solve the issue.

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

4 participants