
- 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 Physical Constants
The scipy.constants module provides access to fundamental physical constants and it also ensures that these values are maintained with the highest accuracy and are regularly updated according to the latest scientific standards.
The constants such as Planck constant, Speed of light etc, play a critical role in converting between units, performing precise calculations and modeling physical phenomena.
Using these standardized constants, scientists and engineers can ensure that their results are consistent with those obtained globally, facilitating collaboration and reproducibility in research.
This module also includes conversion factors allowing seamless transitions between different units of measurement by further enhancing its utility in scientific computation. Following are the different Physical Constants and let's see them in detail −
Planck Constant (h)
Planck Constant is denoted as h,which is a fundamental constant in quantum mechanics. This constant value is 6.626 x 10-34Js that relates the energy of a photon to its frequency. It is essential in the study of quantum phenomena.
Syntax
Here is the syntax of calculating the Planck Constant with the help of Scipy −
scipy.constants.Planck
Example
Below is the example of calculating the Planck constant by using the scipy.constants.Planck method available in SciPy −
from scipy.constants import Planck # Print the Planck constant print(f"The Planck constant (h) is: {Planck}")
Following is the output of the above program −
The Planck constant (h) is: 6.62607015e-34
Planck Mass
Planck massis a natural unit of mass in the system of Planck units which is used in theoretical physics. It is the mass at which the gravitational force between two objects is comparable to other fundamental forces such as electromagnetism.
Theoretically the value of Planck Massis given as 2.176434x10-8 Kilograms. Following is the formula for calculating the Planck Mass(mp) −

Where −
- (h-bar): is the reduced Planck constant.
- c: is the speed of light in a vacuum.
- G: is the gravitational constant.
Example
We know that there is no direct method to calculate the Planck mass with the help SciPy but we can calculate it by using the fundamental constants hbar, c and G. Below is the example −
from scipy.constants import hbar, c, G # Calculate Planck mass m_planck = (hbar * c / G)**0.5 print(f"Planck mass: {m_planck} kg")
Following is the output of the above program −
Planck mass: 2.1764343427178984e-08 kg
Speed of Light
Speed of Light in a vacuum is a fundamental constant that represents the maximum speed at which all energy, matter and information in the universe can travel. It is a critical value in both classical and modern physics particularly in the theory of relativity.
The speed of light in a vacuum is approximately given as 299,792,458 meters per second. Following is the mathematical formula for calculating the speed of light −
E = pc
Where −
- E: is the energy of the photon.
- p: is the momentum of the photon
- c: is the speed of light.
Syntax
Following is the syntax of calculating the speed of light with the help of Scipy −
scipy.constants.c
Example
Below is the example of calculating the speed of light with the help of scipy.constants.c method −
from scipy.constants import c print(f"Speed of light (c): {c} meters per second")
Following is the output of the above program −
Speed of light (c): 299792458.0 meters per second
Gravitational Constant (G)
The Gravitational constant is a fundamental constant used in Newton's law of universal gravitation. It is denoted as G. It describes the strength of the gravitational force between two masses.
The gravitational constant is approximately given as 6.67430x10-11m3kg-1s-2. The mathematical formula for finding the Gravitational Constant is given as follows −

Where −
- F: It is the gravitational force between two masses m1 and m2.
- r: It is the distance between the centers of the two masses.
- G: It is the gravitational constant.
Syntax
Following is the syntax of Gravitational Constant in Scipy −
scipy.constants.G
Example
Below is the example which shows how to find the gravitational constant with the help of scipy.constants.G method −
from scipy.constants import G print(f"Gravitational constant (G): {G} m^3 kg^-1 s^-2")
Following is the output of the above program −
Gravitational constant (G): 6.6743e-11 m^3 kg^-1 s^-2
Permeability of Free Space ()
The Permeability of free space is also known as the magnetic constant which is a physical constant that describes the ability of a vacuum to support the formation of a magnetic field.
It is denoted by the symbol (). It is a fundamental parameter in electromagnetism. The value of permeability of free space is approximately given by 4 x 10-7. The mathematical formula for finding the Permeability is given as follows −
B=0H
Where −
- B: is the magnetic flux density (or magnetic field)
- H: is the magnetic field strength.
Syntax
Following is the syntax of Permeability of Free Space in Scipy −
scipy.constants.mu_0
Example
Below is the example which shows how to find the Permeability using the method scipy.constants.mu_0 which is availabe in Scipy −
from scipy.constants import mu_0 print(f"Permeability of free space (): {mu_0} H/m")
Following is the output of the above program −
Permeability of free space (): 1.25663706212e-06 H/m
Permittivity of Free Space ()
The Permittivity of free space is also known as the electric constant which is a fundamental physical constant that describes how electric fields interact with the vacuum. It is denoted by the symbol . It is a measure of the ability of a vacuum to permit electric field lines.
The value of Permittivity of free space is approximately given as 8.85418781710-12F/m. In Scipy it is represented as epsilon_0.Following is the formula for calculating the Permittivity mathematically −
B=0H
Where −
- B: It is the magnetic flux density (or magnetic field)
- H: It is the magnetic field strength.
Syntax
Following is the syntax of Permittivity of Free Space in Scipy −
scipy.constants.mu_0
Example
Here is the example of calculating the Permittivity of free space by using the scipy.constants.epsilon_0 method −
from scipy.constants import epsilon_0 print(f"Permittivity of free space (): {epsilon_0} F/m")
Following is the output of the above program −
Permittivity of free space (): 8.8541878128e-12 F/m
Fine-Structure Constant ()
The Fine-Structure Constant is a dimensionless fundamental physical constant characterizing the strength of the electromagnetic interaction between elementary charged particles. It is a key parameter in quantum electrodynamics (QED) and reflects the coupling strength of the electromagnetic force. It is denoted by the symbol .
The value of Fine-Structure Constant () is approximately given as 0.0072973525693. In Scipy it is represented as alpha.Following is the formula for calculating the Fine-Structure Constant mathematically −

Where −
- e: It is the elementary charge.
- : It is the permittivity of free space.
- (h-bar): It is the reduced Planck's constant.
- c: It is the speed of light in a vacuum.
Syntax
Following is the syntax of Fine-Structure Constant () in Scipy −
scipy.constants.alpha
Example
Below is the example of calculating the Fine-Structure Constant () by using the scipy.constants.alpha method −
from scipy.constants import alpha print(f"Fine-Structure Constant (): {alpha}")
Following is the output of the above program −
Fine-Structure Constant (): 0.0072973525693
List Of Physical Constants
Here in this tutorial we discussed about only few physical constants which can be used with the help of SciPy library. There are many other such as Stefan-Boltzmann Constant (), Reduced Planck's Constant (), Magnetic Constant (_0), Electric Constant (_0) and so on.
We can get all the constants available in the scipy.constants module with the help of below code −
import scipy from scipy import constants print(dir(scipy.constants))
Following are the constants list −
['Avogadro', 'Boltzmann', 'Btu', 'Btu_IT', 'Btu_th', 'ConstantWarning', 'G', 'Julian_year', 'N_A', 'Planck', 'R', 'Rydberg', 'Stefan_Boltzmann', 'Wien', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_codata', '_constants', '_obsolete_constants', 'acre', 'alpha', 'angstrom', 'arcmin', 'arcminute', 'arcsec', 'arcsecond', 'astronomical_unit',..................................... ........................................................ 'u', 'unit', 'value', 'week', 'yard', 'year', 'yobi', 'yocto', 'yotta', 'zebi', 'zepto', 'zero_Celsius', 'zetta']