atoti.math.cos module#

atoti.math.cos(measure, /)#

Return a measure equal to the cosine of the passed measure in radians.

Example

>>> df = pd.DataFrame(
...     columns=["City", "A", "B", "C", "D"],
...     data=[
...         ("Berlin", 15.0, 10.0, 10.1, 1.0),
...         ("London", 24.0, 16.0, 20.5, 3.14),
...         ("New York", -27.0, 15.0, 30.7, 10.0),
...         ("Paris", 0.0, 0.0, 0.0, 0.0),
...     ],
... )
>>> table = session.read_pandas(df, keys=["City"], table_name="Math")
>>> cube = session.create_cube(table)
>>> l, m = cube.levels, cube.measures
>>> m["cos(D)"] = tt.math.cos(m["D.SUM"])
>>> cube.query(m["D.SUM"], m["cos(D)"], levels=[l["City"]])
          D.SUM cos(D)
City
Berlin     1.00    .54
London     3.14  -1.00
New York  10.00   -.84
Paris       .00   1.00
Return type

MeasureDescription