cudf.Series.tan#

Series.tan()#

Get Trigonometric tangent, 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.tan()
0    0.000000
1    0.336213
2    0.546302
3    1.619775
4   -1.995200
5    1.338690
6   -3.380140
dtype: float64

tan 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.tan()
      first     second
0  0.000000  -0.587214
1 -3.380515  -3.380140
2  0.648361   0.648446
3 -0.855993  45.244742

tan operation on Index:

>>> index = cudf.Index([-0.4, 100, -180, 90])
>>> index
Float64Index([-0.4, 100.0, -180.0, 90.0], dtype='float64')
>>> index.tan()
Float64Index([-0.4227932187381618,  -0.587213915156929,
            -1.3386902103511544, -1.995200412208242],
            dtype='float64')