numpy.unwrap()
functionThe numpy.unwrap()
function is a numpy’s function used to unwrap a given array by transforming deltas
to 2*pi complement
values.
This function unwraps the radian phase, p (arr)
, along the supplied axis
by converting absolute leaps greater than a discount to their 2*pi complement
.
numpy. unwrap ( p,
discount=None,
axis=- 1,
*,
period=6.283185307179586 )
p
: it represents the specified array.discount
: Th parameter is an optional float type. It represents the maximum discontinuity between values. The default value is pi
.axis
: This parameter is an integer type, and it’s optional. It represents the axis along which the unwrap()
function is to be performed. The default value is the last axis
.period
: This parameter is float type, and it’s optional. It represents the size of the input wrap range. The default value is 2 pi
.# import numpyimport numpy as np# create a listmy_list = [24,8,3,4,34,8]# convert the list to numpy arraynp_list = np.array(my_list)print(f"Original array before the np.unwrap(): {np_list}")# unwrap each element and store itnp_list_unwrap = np.unwrap(np_list)print("After the np.unwrap()")print(np_list_unwrap)
numpy
.my_list
.np_list
.np_list
.np.unwrap()
to unwrap the given array, np_list
, by converting it to 2*pi
complement values.