constants.c holds the exact, internationally-defined value of the speed of light in a vacuum, 299,792,458 meters per second — this value is exact by definition, not a measured approximation, since the meter itself is defined in terms of the speed of light and a fixed time interval. It's part of scipy.constants' large collection of standard physical constants, alongside things like Planck's constant and the gravitational constant, sourced from the CODATA recommended values maintained by international standards bodies.
1Understanding constants.c
constants.c holds the exact, internationally-defined value of the speed of light in a vacuum, 299,792,458 meters per second — this value is exact by definition, not a measured approximation, since the meter itself is defined in terms of the speed of light and a fixed time interval. It's part of scipy.constants' large collection of standard physical constants, alongside things like Planck's constant and the gravitational constant, sourced from the CODATA recommended values maintained by international standards bodies.
Use scipy.constants.c, and its physics-constant siblings, instead of hardcoding a physical constant's numeric value directly in your code — it's both more readable, self-documenting as the speed of light, and guaranteed to match the current internationally recognized precise value.
from scipy import constants
print(constants.c)2Practical Example
Here is a real-world application of constants.c showing how it is used in production SciPy code.
from scipy import constants
distance_km = 150_000_000
distance_m = distance_km * 1000
time_seconds = distance_m / constants.c
print(f"{time_seconds / 60:.2f} minutes")3Best Practices
Follow these guidelines when working with constants.c:
1. Use named constants from scipy.constants instead of hardcoding physical constant values directly, for both readability and correctness
2. Double check units when using a physical constant — scipy.constants.c is in meters per second, not other common unit systems like kilometers per hour
3. Explore scipy.constants.physical_constants for constants that also need their uncertainty and unit metadata, not just the bare numeric value
Tip: Use scipy.constants.c, and its physics-constant siblings, instead of hardcoding a physical constant's numeric value directly in your code — it's both more readable, self-documenting as the speed of light, and guaranteed to match the current internationally recognized precise value.
from scipy import constants
print(constants.c)