package scipy

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val get_py : string -> Py.Object.t

Get an attribute of this module as a Py.Object.t. This is useful to pass a Python function to another function.

module ConstantWarning : sig ... end
module Codata : sig ... end
module Constants : sig ... end
val convert_temperature : val_:[> `Ndarray ] Np.Obj.t -> old_scale:string -> new_scale:string -> unit -> Py.Object.t

Convert from a temperature scale to another one among Celsius, Kelvin, Fahrenheit, and Rankine scales.

Parameters ---------- val : array_like Value(s) of the temperature(s) to be converted expressed in the original scale.

old_scale: str Specifies as a string the original scale from which the temperature value(s) will be converted. Supported scales are Celsius ('Celsius', 'celsius', 'C' or 'c'), Kelvin ('Kelvin', 'kelvin', 'K', 'k'), Fahrenheit ('Fahrenheit', 'fahrenheit', 'F' or 'f'), and Rankine ('Rankine', 'rankine', 'R', 'r').

new_scale: str Specifies as a string the new scale to which the temperature value(s) will be converted. Supported scales are Celsius ('Celsius', 'celsius', 'C' or 'c'), Kelvin ('Kelvin', 'kelvin', 'K', 'k'), Fahrenheit ('Fahrenheit', 'fahrenheit', 'F' or 'f'), and Rankine ('Rankine', 'rankine', 'R', 'r').

Returns ------- res : float or array of floats Value(s) of the converted temperature(s) expressed in the new scale.

Notes ----- .. versionadded:: 0.18.0

Examples -------- >>> from scipy.constants import convert_temperature >>> convert_temperature(np.array(-40, 40), 'Celsius', 'Kelvin') array( 233.15, 313.15)

val find : ?sub:string -> ?disp:bool -> unit -> [ `ArrayLike | `Ndarray | `Object ] Np.Obj.t option

Return list of physical_constant keys containing a given string.

Parameters ---------- sub : str, unicode Sub-string to search keys for. By default, return all keys. disp : bool If True, print the keys that are found and return None. Otherwise, return the list of keys without printing anything.

Returns ------- keys : list or None If `disp` is False, the list of keys is returned. Otherwise, None is returned.

Examples -------- >>> from scipy.constants import find, physical_constants

Which keys in the ``physical_constants`` dictionary contain 'boltzmann'?

>>> find('boltzmann') 'Boltzmann constant', 'Boltzmann constant in Hz/K', 'Boltzmann constant in eV/K', 'Boltzmann constant in inverse meter per kelvin', 'Stefan-Boltzmann constant'

Get the constant called 'Boltzmann constant in Hz/K':

>>> physical_constants'Boltzmann constant in Hz/K' (20836619120.0, 'Hz K^-1', 0.0)

Find constants with 'radius' in the key:

>>> find('radius') 'Bohr radius', 'classical electron radius', 'deuteron rms charge radius', 'proton rms charge radius' >>> physical_constants'classical electron radius' (2.8179403262e-15, 'm', 1.3e-24)

val lambda2nu : [> `Ndarray ] Np.Obj.t -> Py.Object.t

Convert wavelength to optical frequency

Parameters ---------- lambda_ : array_like Wavelength(s) to be converted.

Returns ------- nu : float or array of floats Equivalent optical frequency.

Notes ----- Computes ``nu = c / lambda`` where c = 299792458.0, i.e., the (vacuum) speed of light in meters/second.

Examples -------- >>> from scipy.constants import lambda2nu, speed_of_light >>> lambda2nu(np.array((1, speed_of_light))) array( 2.99792458e+08, 1.00000000e+00)

val nu2lambda : [> `Ndarray ] Np.Obj.t -> Py.Object.t

Convert optical frequency to wavelength.

Parameters ---------- nu : array_like Optical frequency to be converted.

Returns ------- lambda : float or array of floats Equivalent wavelength(s).

Notes ----- Computes ``lambda = c / nu`` where c = 299792458.0, i.e., the (vacuum) speed of light in meters/second.

Examples -------- >>> from scipy.constants import nu2lambda, speed_of_light >>> nu2lambda(np.array((1, speed_of_light))) array( 2.99792458e+08, 1.00000000e+00)

val precision : [ `Python_string of Py.Object.t | `S of string ] -> float

Relative precision in physical_constants indexed by key

Parameters ---------- key : Python string or unicode Key in dictionary `physical_constants`

Returns ------- prec : float Relative precision in `physical_constants` corresponding to `key`

Examples -------- >>> from scipy import constants >>> constants.precision(u'proton mass') 5.1e-37

val unit : [ `Python_string of Py.Object.t | `S of string ] -> Py.Object.t

Unit in physical_constants indexed by key

Parameters ---------- key : Python string or unicode Key in dictionary `physical_constants`

Returns ------- unit : Python string Unit in `physical_constants` corresponding to `key`

Examples -------- >>> from scipy import constants >>> constants.unit(u'proton mass') 'kg'

val value : [ `Python_string of Py.Object.t | `S of string ] -> float

Value in physical_constants indexed by key

Parameters ---------- key : Python string or unicode Key in dictionary `physical_constants`

Returns ------- value : float Value in `physical_constants` corresponding to `key`

Examples -------- >>> from scipy import constants >>> constants.value(u'elementary charge') 1.602176634e-19

OCaml

Innovation. Community. Security.