Curriculum
Course: SCIPY
Login
Text lesson

SciPy Constant

Constants in SciPy

Since SciPy is geared towards scientific applications, it offers numerous built-in scientific constants that can be useful when working in data science.

PI is an example of a mathematical constant.

Example

Display the value of the PI constant:

from scipy import constants

print(constants.pi)

Constant Units

You can view a list of all units in the constants module by using the dir() function.

Example

Display all available constants:

from scipy import constants

print(dir(constants))

Unit Categories

The units are organized into the following categories:

  • Metric
  • Binary
  • Mass
  • Angle
  • Time
  • Length
  • Pressure
  • Volume
  • Speed
  • Temperature
  • Energy
  • Power
  • Force