This is a pre-release version (2.0.0.dev0+git20260907.41eeb59).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / _external / array_api_extra / _delegation / deg2rad

function

scipy._external.array_api_extra._delegation:deg2rad

source: build-install/usr/lib/python3.14/site-packages/scipy/_external/array_api_extra/_delegation.py:328

Signature

def deg2rad(x: Array, /, xp: ArrayNamespace | None = None) → Array

Summary

Convert angles from degrees to radians.

Parameters

x : array

Input array in degrees. Must have an integral or floating-point dtype.

xp : array_namespace, optional

The standard-compatible namespace for x. Default: infer.

Returns

: array

The corresponding angles in radians. Integral inputs are converted to the default floating-point dtype.

Examples

import array_api_strict as xp
import array_api_extra as xpx
xpx.deg2rad(xp.asarray([0, 90, 180]), xp=xp)
⚠
Traceback (most recent call last):
  File "<doctest scipy._external.array_api_extra._delegation:deg2rad[0]>", line 1, in <module>
    xpx.deg2rad(xp.asarray([0, 90, 180]), xp=xp)
    ^^^
NameError: name 'xpx' is not defined

Aliases

  • scipy.differentiate.xpx.deg2rad