Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8527165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:28:44+00:00 2026-06-11T08:28:44+00:00

How to calculate probability in normal distribution given mean, std in Python? I can

  • 0

How to calculate probability in normal distribution given mean, std in Python? I can always explicitly code my own function according to the definition like the OP in this question did: Calculating Probability of a Random Variable in a Distribution in Python

Just wondering if there is a library function call will allow you to do this. In my imagine it would like this:

nd = NormalDistribution(mu=100, std=12)
p = nd.prob(98)

There is a similar question in Perl: How can I compute the probability at a point given a normal distribution in Perl?. But I didn’t see one in Python.

Numpy has a random.normal function, but it’s like sampling, not exactly what I want.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:28:46+00:00Added an answer on June 11, 2026 at 8:28 am

    There’s one in scipy.stats:

    >>> import scipy.stats
    >>> scipy.stats.norm(0, 1)
    <scipy.stats.distributions.rv_frozen object at 0x928352c>
    >>> scipy.stats.norm(0, 1).pdf(0)
    0.3989422804014327
    >>> scipy.stats.norm(0, 1).cdf(0)
    0.5
    >>> scipy.stats.norm(100, 12)
    <scipy.stats.distributions.rv_frozen object at 0x928352c>
    >>> scipy.stats.norm(100, 12).pdf(98)
    0.032786643008494994
    >>> scipy.stats.norm(100, 12).cdf(98)
    0.43381616738909634
    >>> scipy.stats.norm(100, 12).cdf(100)
    0.5
    

    [One thing to beware of — just a tip — is that the parameter passing is a little broad. Because of the way the code is set up, if you accidentally write scipy.stats.norm(mean=100, std=12) instead of scipy.stats.norm(100, 12) or scipy.stats.norm(loc=100, scale=12), then it’ll accept it, but silently discard those extra keyword arguments and give you the default (0,1).]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given a mean and standard-deviation defining a normal distribution , how would you calculate
I need to calculate the probability mass function, and cumulative distribution function, of the
I have written a code in Python to create a transition probability matrix from
I am doing some work in C# to calculate the binomial probability density function
I have to calculate the Specular Highlights (phong) of an Image. the normal Vector
How can I calculate the date having only the week number and day of
EDIT: The correct version of the code which works can be found at :
I have a function that is supposed to calculate the number of times a
Given the start and the end of an integer range, how do I calculate
this is mathematical question for programming needs... whats the way to calculate probability if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.