
- SciPy - Home
- SciPy - Introduction
- SciPy - Environment Setup
- SciPy - Basic Functionality
- SciPy - Relationship with NumPy
- SciPy Clusters
- SciPy - Clusters
- SciPy - Hierarchical Clustering
- SciPy - K-means Clustering
- SciPy - Distance Metrics
- SciPy Constants
- SciPy - Constants
- SciPy - Mathematical Constants
- SciPy - Physical Constants
- SciPy - Unit Conversion
- SciPy - Astronomical Constants
- SciPy - Fourier Transforms
- SciPy - FFTpack
- SciPy - Discrete Fourier Transform (DFT)
- SciPy - Fast Fourier Transform (FFT)
- SciPy Integration Equations
- SciPy - Integrate Module
- SciPy - Single Integration
- SciPy - Double Integration
- SciPy - Triple Integration
- SciPy - Multiple Integration
- SciPy Differential Equations
- SciPy - Differential Equations
- SciPy - Integration of Stochastic Differential Equations
- SciPy - Integration of Ordinary Differential Equations
- SciPy - Discontinuous Functions
- SciPy - Oscillatory Functions
- SciPy - Partial Differential Equations
- SciPy Interpolation
- SciPy - Interpolate
- SciPy - Linear 1-D Interpolation
- SciPy - Polynomial 1-D Interpolation
- SciPy - Spline 1-D Interpolation
- SciPy - Grid Data Multi-Dimensional Interpolation
- SciPy - RBF Multi-Dimensional Interpolation
- SciPy - Polynomial & Spline Interpolation
- SciPy Curve Fitting
- SciPy - Curve Fitting
- SciPy - Linear Curve Fitting
- SciPy - Non-Linear Curve Fitting
- SciPy - Input & Output
- SciPy - Input & Output
- SciPy - Reading & Writing Files
- SciPy - Working with Different File Formats
- SciPy - Efficient Data Storage with HDF5
- SciPy - Data Serialization
- SciPy Linear Algebra
- SciPy - Linalg
- SciPy - Matrix Creation & Basic Operations
- SciPy - Matrix LU Decomposition
- SciPy - Matrix QU Decomposition
- SciPy - Singular Value Decomposition
- SciPy - Cholesky Decomposition
- SciPy - Solving Linear Systems
- SciPy - Eigenvalues & Eigenvectors
- SciPy Image Processing
- SciPy - Ndimage
- SciPy - Reading & Writing Images
- SciPy - Image Transformation
- SciPy - Filtering & Edge Detection
- SciPy - Top Hat Filters
- SciPy - Morphological Filters
- SciPy - Low Pass Filters
- SciPy - High Pass Filters
- SciPy - Bilateral Filter
- SciPy - Median Filter
- SciPy - Non - Linear Filters in Image Processing
- SciPy - High Boost Filter
- SciPy - Laplacian Filter
- SciPy - Morphological Operations
- SciPy - Image Segmentation
- SciPy - Thresholding in Image Segmentation
- SciPy - Region-Based Segmentation
- SciPy - Connected Component Labeling
- SciPy Optimize
- SciPy - Optimize
- SciPy - Special Matrices & Functions
- SciPy - Unconstrained Optimization
- SciPy - Constrained Optimization
- SciPy - Matrix Norms
- SciPy - Sparse Matrix
- SciPy - Frobenius Norm
- SciPy - Spectral Norm
- SciPy Condition Numbers
- SciPy - Condition Numbers
- SciPy - Linear Least Squares
- SciPy - Non-Linear Least Squares
- SciPy - Finding Roots of Scalar Functions
- SciPy - Finding Roots of Multivariate Functions
- SciPy - Signal Processing
- SciPy - Signal Filtering & Smoothing
- SciPy - Short-Time Fourier Transform
- SciPy - Wavelet Transform
- SciPy - Continuous Wavelet Transform
- SciPy - Discrete Wavelet Transform
- SciPy - Wavelet Packet Transform
- SciPy - Multi-Resolution Analysis
- SciPy - Stationary Wavelet Transform
- SciPy - Statistical Functions
- SciPy - Stats
- SciPy - Descriptive Statistics
- SciPy - Continuous Probability Distributions
- SciPy - Discrete Probability Distributions
- SciPy - Statistical Tests & Inference
- SciPy - Generating Random Samples
- SciPy - Kaplan-Meier Estimator Survival Analysis
- SciPy - Cox Proportional Hazards Model Survival Analysis
- SciPy Spatial Data
- SciPy - Spatial
- SciPy - Special Functions
- SciPy - Special Package
- SciPy Advanced Topics
- SciPy - CSGraph
- SciPy - ODR
- SciPy Useful Resources
- SciPy - Reference
- SciPy - Quick Guide
- SciPy - Cheatsheet
- SciPy - Useful Resources
- SciPy - Discussion
SciPy - stats.norm.ppf() Function
scipy.stats.norm.ppf() is a function in the SciPy library that computes the percent-point function (PPF), also known as the inverse cumulative distribution function (Inverse CDF), of a normal distribution. This function is useful for finding the value of x corresponding to a given cumulative probability. It is part of SciPys stats module where loc represents the mean () and scale is the standard deviation ().
The percent-point function is mathematically defined as the inverse of the cumulative distribution function (CDF):
$\mathrm{x = F^{-1}(p)}$
where:
- F(x) is the cumulative distribution function (CDF).
- p is the given cumulative probability.
- F(p) is the inverse CDF (percent-point function).
Syntax
Following is the syntax for using scipy.stats.norm.ppf() which is used to compute inverse percent-point function −
scipy.stats.norm.ppf(q, loc=0, scale=1)
Parameters
Below are the parameters of the function scipy.stats.norm.ppf() −
- q: The cumulative probability (quantile) for which the corresponding x value is computed.
- loc (optional): The mean () of the normal distribution. Default value is 0.
- scale (optional): The standard deviation () of the normal distribution. Default value is 1.
Return Value
This function returns the x value corresponding to the given cumulative probability q in a normal distribution.
Computing the 50th Percentile (Median)
The 50th percentile (median) of a standard normal distribution is mean = 0 and standard deviation = 1. This can be computed using scipy.stats.norm.ppf() −
from scipy.stats import norm q = 0.5 # 50th percentile x_value = norm.ppf(q, loc=0, scale=1) print(f"Value at the 50th percentile: {x_value}")
Below is the output of computing 50th percentile −
Value at the 50th percentile: 0.0
Computing the 95th Percentile
For a normal distribution with mean = 100 and standard deviation = 15 the 95th percentile can be calculated with the help of below example −
from scipy.stats import norm q = 0.95 x_value = norm.ppf(q, loc=100, scale=15) print(f"Value at the 95th percentile: {x_value}")
Here is the output of the computing the 95th Percentile −
Value at the 95th percentile: 124.67280440427209
Plotting the Inverse CDF (PPF)
The percent-point function (PPF) maps cumulative probabilities to x values. Below is a plot of the PPF for a standard normal distribution −
import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm q_values = np.linspace(0.01, 0.99, 100) x_values = norm.ppf(q_values, loc=0, scale=1) plt.plot(q_values, x_values, label="Standard Normal PPF", color="green") plt.title("Percent-Point Function (PPF)") plt.xlabel("Cumulative Probability (q)") plt.ylabel("x Value") plt.legend() plt.grid(True) plt.show()
Below is the output plot of the Inverse CDF i.e., PPF −

Finding the 10th Percentile
In this example, we compute the 10th percentile for a normal distribution with mean = 50 and standard deviation = 10 −
from scipy.stats import norm q = 0.10 x_value = norm.ppf(q, loc=50, scale=10) print(f"Value at the 10th percentile: {x_value}")
Here is the output of computing the 10th Percentile −
Value at the 10th percentile: 37.184484344553994