cudf.DataFrame.sin#

DataFrame.sin()#

Get Trigonometric sine, element-wise.

Returns
DataFrame/Series/Index

Result of the trigonometric operation.

Examples

>>> import cudf
>>> ser = cudf.Series([0.0, 0.32434, 0.5, 45, 90, 180, 360])
>>> ser
0      0.00000
1      0.32434
2      0.50000
3     45.00000
4     90.00000
5    180.00000
6    360.00000
dtype: float64
>>> ser.sin()
0    0.000000
1    0.318683
2    0.479426
3    0.850904
4    0.893997
5   -0.801153
6    0.958916
dtype: float64

sin operation on DataFrame:

>>> df = cudf.DataFrame({'first': [0.0, 5, 10, 15],
...                      'second': [100.0, 360, 720, 300]})
>>> df
   first  second
0    0.0   100.0
1    5.0   360.0
2   10.0   720.0
3   15.0   300.0
>>> df.sin()
      first    second
0  0.000000 -0.506366
1 -0.958924  0.958916
2 -0.544021 -0.544072
3  0.650288 -0.999756

sin operation on Index:

>>> index = cudf.Index([-0.4, 100, -180, 90])
>>> index
Float64Index([-0.4, 100.0, -180.0, 90.0], dtype='float64')
>>> index.sin()
Float64Index([-0.3894183423086505, -0.5063656411097588,
            0.8011526357338306, 0.8939966636005579],
            dtype='float64')