![]() |
VOOZH | about |
In scientific and mathematical calculations, universal constants such as π (pi) or the gravitational constant G are frequently needed. Whether it's determining the area of a circle or calculating gravitational force, having reliable constants readily available helps streamline the process.
Scipy.constants module in SciPy allows users to access collection of mathematical, physical and unit conversion constants effortlessly with a single line of code.
Constants can be accessed using the format:
scipy.constants.CONSTANT_NAME
Below listed constants are commonly used:
Output
Use the find() method to search for constants by keyword.
Output
Not only the value but also the corresponding unit and the degree of uncertainty of a physical constant can be retrieved using physical_constants dictionary from scipy.constants.
scipy.constants.physical_constants['name']
Output
(6.644657345e-27, 'kg', 2.1e-36)
Output
| Constants | Description |
|---|---|
| pi | Mathematical constant π |
| golden_ratio | Golden ratio |
| c or speed_of_light | Speed of light in vacuum |
| G | Gravitational constant |
| E | Elementary charge |
| R | Molar gas constant |
| alpha | Fine-structure constant |
| N_A | Avogadro constant |
| k | Boltzmann constant |
| sigma | Stefan-Boltzmann constant σ |
| m_e | Electron mass |
| m_p | Proton mass |
| m_n | Neutron Mass |
| h or Planck | Planck Constant |
Mass Units:
| Unit | Description |
|---|---|
| gram | One gram in kilograms. |
| grain | One grain in kilograms. |
| pound | One Pound in kilograms. |
| ounce | One Ounce in kilograms. |
| automic_mass | Atomics mass constant in kilograms. |
Time Units:
| Unit | Description |
|---|---|
| minute | One minute in seconds. |
| hour | One hour in seconds. |
| day | One day in seconds. |
| year | One year in seconds. |
Length Units:
| Units | Description |
|---|---|
| inch | One inch in meters. |
| foot | One foot in meters. |
| yard | One yard in meters. |
| pt | One point in meters. |
| micron | One Micron in meters. |
Pressure Units:
| Units | Description |
|---|---|
| atm/atmosphere | The standard atmosphere in pascals. |
| bar | One bar in Pascals. |
| torr | One torr(mmHg) in pascals. |
Area Units:
| Units | Description |
|---|---|
| hectare | One hectare in square meters. |
| acre | One acre in square meters. |
Speed Units:
| Units | Description |
|---|---|
| kmh | Kilometer per hour in meter per second. |
| mph | Miles per hour in meter per second. |
| mach | One Match in meter per second. |
Related Articles: