From a90feffce692a9eb830f35024ba9f43eae48371e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Braulio=20R=C3=ADos?= Date: Tue, 31 Oct 2023 17:10:31 -0300 Subject: [PATCH 1/4] Removed op aliases from __init__ and related docs --- docs/public_api_test.py | 31 ---------------- .../temporian/operators/binary/add.md | 0 .../temporian/operators/binary/divide.md | 0 .../temporian/operators/binary/equal.md | 0 .../temporian/operators/binary/floordiv.md | 0 .../temporian/operators/binary/greater.md | 0 .../operators/binary/greater_equal.md | 0 .../temporian/operators/binary/less.md | 0 .../temporian/operators/binary/less_equal.md | 0 .../temporian/operators/binary/logical_and.md | 0 .../temporian/operators/binary/logical_or.md | 0 .../temporian/operators/binary/logical_xor.md | 0 .../temporian/operators/binary/modulo.md | 0 .../temporian/operators/binary/multiply.md | 0 .../temporian/operators/binary/not_equal.md | 0 .../temporian/operators/binary/power.md | 0 .../temporian/operators/binary/subtract.md | 0 .../temporian/operators/scalar/add_scalar.md | 0 .../operators/scalar/divide_scalar.md | 0 .../operators/scalar/equal_scalar.md | 0 .../operators/scalar/floordiv_scalar.md | 0 .../operators/scalar/greater_equal_scalar.md | 0 .../operators/scalar/greater_scalar.md | 0 .../operators/scalar/less_equal_scalar.md | 0 .../temporian/operators/scalar/less_scalar.md | 0 .../operators/scalar/modulo_scalar.md | 0 .../operators/scalar/multiply_scalar.md | 0 .../operators/scalar/not_equal_scalar.md | 0 .../operators/scalar/power_scalar.md | 0 .../operators/scalar/subtract_scalar.md | 0 temporian/__init__.py | 36 ------------------- 31 files changed, 67 deletions(-) delete mode 100644 docs/src/reference/temporian/operators/binary/add.md delete mode 100644 docs/src/reference/temporian/operators/binary/divide.md delete mode 100644 docs/src/reference/temporian/operators/binary/equal.md delete mode 100644 docs/src/reference/temporian/operators/binary/floordiv.md delete mode 100644 docs/src/reference/temporian/operators/binary/greater.md delete mode 100644 docs/src/reference/temporian/operators/binary/greater_equal.md delete mode 100644 docs/src/reference/temporian/operators/binary/less.md delete mode 100644 docs/src/reference/temporian/operators/binary/less_equal.md delete mode 100644 docs/src/reference/temporian/operators/binary/logical_and.md delete mode 100644 docs/src/reference/temporian/operators/binary/logical_or.md delete mode 100644 docs/src/reference/temporian/operators/binary/logical_xor.md delete mode 100644 docs/src/reference/temporian/operators/binary/modulo.md delete mode 100644 docs/src/reference/temporian/operators/binary/multiply.md delete mode 100644 docs/src/reference/temporian/operators/binary/not_equal.md delete mode 100644 docs/src/reference/temporian/operators/binary/power.md delete mode 100644 docs/src/reference/temporian/operators/binary/subtract.md delete mode 100644 docs/src/reference/temporian/operators/scalar/add_scalar.md delete mode 100644 docs/src/reference/temporian/operators/scalar/divide_scalar.md delete mode 100644 docs/src/reference/temporian/operators/scalar/equal_scalar.md delete mode 100644 docs/src/reference/temporian/operators/scalar/floordiv_scalar.md delete mode 100644 docs/src/reference/temporian/operators/scalar/greater_equal_scalar.md delete mode 100644 docs/src/reference/temporian/operators/scalar/greater_scalar.md delete mode 100644 docs/src/reference/temporian/operators/scalar/less_equal_scalar.md delete mode 100644 docs/src/reference/temporian/operators/scalar/less_scalar.md delete mode 100644 docs/src/reference/temporian/operators/scalar/modulo_scalar.md delete mode 100644 docs/src/reference/temporian/operators/scalar/multiply_scalar.md delete mode 100644 docs/src/reference/temporian/operators/scalar/not_equal_scalar.md delete mode 100644 docs/src/reference/temporian/operators/scalar/power_scalar.md delete mode 100644 docs/src/reference/temporian/operators/scalar/subtract_scalar.md diff --git a/docs/public_api_test.py b/docs/public_api_test.py index 74ba22967..2a8b8eebd 100644 --- a/docs/public_api_test.py +++ b/docs/public_api_test.py @@ -58,37 +58,6 @@ # OPERATORS "glue", "combine", - # BINARY OPERATORS - "add", - "subtract", - "multiply", - "divide", - "floordiv", - "modulo", - "power", - "equal", - "not_equal", - "greater", - "greater_equal", - "less", - "less_equal", - "logical_and", - "logical_or", - "logical_xor", - # SCALAR OPERATORS - "add_scalar", - "subtract_scalar", - "multiply_scalar", - "divide_scalar", - "floordiv_scalar", - "modulo_scalar", - "power_scalar", - "equal_scalar", - "not_equal_scalar", - "greater_equal_scalar", - "greater_scalar", - "less_equal_scalar", - "less_scalar", } diff --git a/docs/src/reference/temporian/operators/binary/add.md b/docs/src/reference/temporian/operators/binary/add.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/divide.md b/docs/src/reference/temporian/operators/binary/divide.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/equal.md b/docs/src/reference/temporian/operators/binary/equal.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/floordiv.md b/docs/src/reference/temporian/operators/binary/floordiv.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/greater.md b/docs/src/reference/temporian/operators/binary/greater.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/greater_equal.md b/docs/src/reference/temporian/operators/binary/greater_equal.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/less.md b/docs/src/reference/temporian/operators/binary/less.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/less_equal.md b/docs/src/reference/temporian/operators/binary/less_equal.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/logical_and.md b/docs/src/reference/temporian/operators/binary/logical_and.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/logical_or.md b/docs/src/reference/temporian/operators/binary/logical_or.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/logical_xor.md b/docs/src/reference/temporian/operators/binary/logical_xor.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/modulo.md b/docs/src/reference/temporian/operators/binary/modulo.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/multiply.md b/docs/src/reference/temporian/operators/binary/multiply.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/not_equal.md b/docs/src/reference/temporian/operators/binary/not_equal.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/power.md b/docs/src/reference/temporian/operators/binary/power.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/binary/subtract.md b/docs/src/reference/temporian/operators/binary/subtract.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/scalar/add_scalar.md b/docs/src/reference/temporian/operators/scalar/add_scalar.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/scalar/divide_scalar.md b/docs/src/reference/temporian/operators/scalar/divide_scalar.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/scalar/equal_scalar.md b/docs/src/reference/temporian/operators/scalar/equal_scalar.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/scalar/floordiv_scalar.md b/docs/src/reference/temporian/operators/scalar/floordiv_scalar.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/scalar/greater_equal_scalar.md b/docs/src/reference/temporian/operators/scalar/greater_equal_scalar.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/scalar/greater_scalar.md b/docs/src/reference/temporian/operators/scalar/greater_scalar.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/scalar/less_equal_scalar.md b/docs/src/reference/temporian/operators/scalar/less_equal_scalar.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/scalar/less_scalar.md b/docs/src/reference/temporian/operators/scalar/less_scalar.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/scalar/modulo_scalar.md b/docs/src/reference/temporian/operators/scalar/modulo_scalar.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/scalar/multiply_scalar.md b/docs/src/reference/temporian/operators/scalar/multiply_scalar.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/scalar/not_equal_scalar.md b/docs/src/reference/temporian/operators/scalar/not_equal_scalar.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/scalar/power_scalar.md b/docs/src/reference/temporian/operators/scalar/power_scalar.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/src/reference/temporian/operators/scalar/subtract_scalar.md b/docs/src/reference/temporian/operators/scalar/subtract_scalar.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/temporian/__init__.py b/temporian/__init__.py index 4af4f97bb..9a13433a0 100644 --- a/temporian/__init__.py +++ b/temporian/__init__.py @@ -98,42 +98,6 @@ from temporian.core.operators.glue import glue from temporian.core.operators.combine import combine -# Binary operators -from temporian.core.operators.binary.arithmetic import add -from temporian.core.operators.binary.arithmetic import subtract -from temporian.core.operators.binary.arithmetic import multiply -from temporian.core.operators.binary.arithmetic import divide -from temporian.core.operators.binary.arithmetic import floordiv -from temporian.core.operators.binary.arithmetic import modulo -from temporian.core.operators.binary.arithmetic import power - -from temporian.core.operators.binary.relational import equal -from temporian.core.operators.binary.relational import not_equal -from temporian.core.operators.binary.relational import greater -from temporian.core.operators.binary.relational import greater_equal -from temporian.core.operators.binary.relational import less -from temporian.core.operators.binary.relational import less_equal - -from temporian.core.operators.binary.logical import logical_and -from temporian.core.operators.binary.logical import logical_or -from temporian.core.operators.binary.logical import logical_xor - -# Scalar operators -from temporian.core.operators.scalar.arithmetic_scalar import add_scalar -from temporian.core.operators.scalar.arithmetic_scalar import subtract_scalar -from temporian.core.operators.scalar.arithmetic_scalar import multiply_scalar -from temporian.core.operators.scalar.arithmetic_scalar import divide_scalar -from temporian.core.operators.scalar.arithmetic_scalar import floordiv_scalar -from temporian.core.operators.scalar.arithmetic_scalar import modulo_scalar -from temporian.core.operators.scalar.arithmetic_scalar import power_scalar - -from temporian.core.operators.scalar.relational_scalar import equal_scalar -from temporian.core.operators.scalar.relational_scalar import not_equal_scalar -from temporian.core.operators.scalar.relational_scalar import greater_equal_scalar -from temporian.core.operators.scalar.relational_scalar import greater_scalar -from temporian.core.operators.scalar.relational_scalar import less_equal_scalar -from temporian.core.operators.scalar.relational_scalar import less_scalar - # Remove automatic file tree symbols from public API # pylint: disable=undefined-variable del proto From b904b36c2601b9d1cfa884fbaa2c70867ac40cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Braulio=20R=C3=ADos?= Date: Tue, 31 Oct 2023 17:11:04 -0300 Subject: [PATCH 2/4] Updated reference index section on python ops. --- docs/src/reference/index.md | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/docs/src/reference/index.md b/docs/src/reference/index.md index dd0da6e03..6e24dd3e3 100644 --- a/docs/src/reference/index.md +++ b/docs/src/reference/index.md @@ -36,6 +36,7 @@ Check the index on the left for a more detailed description of any symbol. | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | [`tp.duration.milliseconds()`][temporian.duration.milliseconds] [`tp.duration.seconds()`][temporian.duration.seconds] [`tp.duration.minutes()`][temporian.duration.minutes] [`tp.duration.hours()`][temporian.duration.hours] [`tp.duration.days()`][temporian.duration.days] [`tp.duration.weeks()`][temporian.duration.weeks] | Convert input value from milliseconds / seconds / minutes / hours / days / weeks to a `Duration` in seconds. | + ## Operators | Symbols | Description | @@ -75,14 +76,6 @@ Check the index on the left for a more detailed description of any symbol. | [`EventSet.until_next()`][temporian.EventSet.until_next] | Duration until the next sampling event. | | [`EventSet.where()`][temporian.EventSet.where] | Choose events from two possible sources, based on boolean conditions. | -### Binary operators - -| Symbols | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| [`tp.add()`][temporian.add] [`tp.subtract()`][temporian.subtract] [`tp.multiply()`][temporian.multiply] [`tp.divide()`][temporian.divide] [`tp.floordiv()`][temporian.floordiv] [`tp.modulo()`][temporian.modulo] [`tp.power()`][temporian.power] | Compute an arithmetic binary operation between two [`EventSets`][temporian.EventSet]. Aliases for `+`, `-`, `\*`, `/`, etc. | -| [`tp.equal()`][temporian.equal] [`tp.not_equal()`][temporian.not_equal] [`tp.greater()`][temporian.greater] [`tp.greater_equal()`][temporian.greater_equal] [`tp.less()`][temporian.less] [`tp.less_equal()`][temporian.less_equal] | Compute a relational binary operator between two [`EventSets`][temporian.EventSet]. | -| [`tp.logical_and()`][temporian.logical_and] [`tp.logical_or()`][temporian.logical_or] [`tp.logical_xor()`][temporian.logical_xor] | Compute a logical binary operation between two [`EventSets`][temporian.EventSet]. | - ### Calendar operators @@ -90,15 +83,16 @@ Check the index on the left for a more detailed description of any symbol. | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [`EventSet.calendar_day_of_month()`][temporian.EventSet.calendar_day_of_month] [`EventSet.calendar_day_of_week()`][temporian.EventSet.calendar_day_of_week] [`EventSet.calendar_day_of_year()`][temporian.EventSet.calendar_day_of_year] [`EventSet.calendar_hour()`][temporian.EventSet.calendar_hour] [`EventSet.calendar_iso_week()`][temporian.EventSet.calendar_iso_week] [`EventSet.calendar_minute()`][temporian.EventSet.calendar_minute] [`EventSet.calendar_month()`][temporian.EventSet.calendar_month] [`EventSet.calendar_second()`][temporian.EventSet.calendar_second] [`EventSet.calendar_year()`][temporian.EventSet.calendar_year] | Obtain the day of month / day of week / day of year / hour / ISO week / minute / month / second / year the timestamps in an [`EventSet`][temporian.EventSet] are in. | -### Scalar operators - -| Symbols | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| [`tp.add_scalar()`][temporian.add_scalar] [`tp.subtract_scalar()`][temporian.subtract_scalar] [`tp.multiply_scalar()`][temporian.multiply_scalar] [`tp.divide_scalar()`][temporian.divide_scalar] [`tp.floordiv_scalar()`][temporian.floordiv_scalar] [`tp.modulo_scalar()`][temporian.modulo_scalar] [`tp.power_scalar()`][temporian.power_scalar] | Compute an arithmetic operation between an [`EventSet`][temporian.EventSet] and a scalar value. | -| [`tp.equal_scalar()`][temporian.equal_scalar] [`tp.not_equal_scalar()`][temporian.not_equal_scalar] [`tp.greater_equal_scalar()`][temporian.greater_equal_scalar] [`tp.greater_scalar()`][temporian.greater_scalar] [`tp.less_equal_scalar()`][temporian.less_equal_scalar] [`tp.less_scalar()`][temporian.less_scalar] | Compute a relational operation between an [`EventSet`][temporian.EventSet] and a scalar value. | - ### Window operators | Symbols | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | | [`EventSet.simple_moving_average()`][temporian.EventSet.simple_moving_average] [`EventSet.moving_standard_deviation()`][temporian.EventSet.moving_standard_deviation] [`EventSet.cumsum()`][temporian.EventSet.cumsum] [`EventSet.moving_sum()`][temporian.EventSet.moving_sum] [`EventSet.moving_count()`][temporian.EventSet.moving_count] [`EventSet.moving_min()`][temporian.EventSet.moving_min] [`EventSet.moving_max()`][temporian.EventSet.moving_max] | Compute an operation on the values in a sliding window over an EventSet's timestamps. | + +### Python operators + +| Symbols | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `+` (add), `-` (subtract), `\*` (multiply), `/` (divide), `//` (floor divide), `%` (modulo), `**` (power) | Event-wise arithmetic operations between two `EventSets` or with a scalar number. See the corresponding [User Guide section](../user_guide#arithmetic-operators) for more info. | +| `!=` (not equal), `>` (greater than), `>=` (greater or equal), `<` (less), `<=` (less or equal) | Event-wise comparison between `EventSets` or to a scalar number. Note that `==` is not supported, use `EventSet.equal()` instead. See the [User Guide](../user_guide#comparisons) for more info. | +| `&` (and), `\|` (or), `^` (xor) | Event-wise logic operators between boolean `EventSets`. | \ No newline at end of file From 17161ad4ebb25e6c706e0cef06d87b46fd3fa060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Braulio=20R=C3=ADos?= Date: Tue, 31 Oct 2023 17:11:37 -0300 Subject: [PATCH 3/4] Removed deprecated docstrings --- temporian/core/operators/binary/arithmetic.py | 448 ------------------ temporian/core/operators/binary/logical.py | 135 ------ temporian/core/operators/binary/relational.py | 256 ---------- .../operators/scalar/arithmetic_scalar.py | 280 ----------- .../operators/scalar/relational_scalar.py | 213 --------- temporian/core/operators/unary.py | 38 -- 6 files changed, 1370 deletions(-) diff --git a/temporian/core/operators/binary/arithmetic.py b/temporian/core/operators/binary/arithmetic.py index 72e69427c..18266b464 100644 --- a/temporian/core/operators/binary/arithmetic.py +++ b/temporian/core/operators/binary/arithmetic.py @@ -92,146 +92,6 @@ def add( input_1: EventSetOrNode, input_2: EventSetOrNode, ) -> EventSetOrNode: - """Adds two [`EventSets`][temporian.EventSet]. - - Each feature in `input_1` is added to the feature in `input_2` in the same - position. - - `input_1` and `input_2` must have the same sampling, index, - number of features and dtype for the features in the same positions. - - Basic example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200], "f2": [10, -10, 5]} - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f3": [-1, 1, 2], "f4": [1, -1, 5]}, - ... same_sampling_as=a - ... ) - - >>> # Equivalent - >>> c = tp.add(a, b) - >>> c = a + b - >>> c - indexes: [] - features: [('add_f1_f3', int64), ('add_f2_f4', int64)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'add_f1_f3': [ -1 101 202] - 'add_f2_f4': [ 11 -11 10] - ... - - ``` - - Cast dtypes example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200], "f2": [10., -10., 5.]} - ... ) - - >>> # Cannot add: f1 is int64 but f2 is float64 - >>> c = a["f1"] + a["f2"] - Traceback (most recent call last): - ... - ValueError: ... corresponding features should have the same dtype. ... - - >>> # Cast f1 to float - >>> c = a["f1"].cast(tp.float64) + a["f2"] - >>> c - indexes: [] - features: [('add_f1_f2', float64)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'add_f1_f2': [ 10. 90. 205.] - ... - - ``` - - Resample example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"fa": [1, 2, 3]}, - ... ) - >>> b = tp.event_set( - ... timestamps=[-1, 1.5, 3, 5], - ... features={"fb": [-10, 15, 30, 50]}, - ... ) - - >>> # Cannot add different samplings - >>> c = a + b - Traceback (most recent call last): - ... - ValueError: ... should have the same sampling. ... - - >>> # Resample a to match b timestamps - >>> c = a.resample(b) + b - >>> c - indexes: [] - features: [('add_fa_fb', int64)] - events: - (4 events): - timestamps: [-1. 1.5 3. 5. ] - 'add_fa_fb': [-10 16 33 53] - ... - - ``` - - Reindex example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3, 4], - ... features={ - ... "cat": [1, 1, 2, 2], - ... "M": [10, 20, 30, 40] - ... }, - ... indexes=["cat"] - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3, 4], - ... features={ - ... "cat": [1, 1, 2, 2], - ... "N": [10, 20, 30, 40] - ... }, - ... ) - - >>> # Cannot add with different index (only 'a' is indexed by 'cat') - >>> c = a + b - Traceback (most recent call last): - ... - ValueError: Arguments don't have the same index. ... - - >>> # Add index 'cat' to b - >>> b = b.add_index("cat") - >>> # Make explicit same samplings and add - >>> c = a + b.resample(a) - >>> c - indexes: [('cat', int64)] - features: [('add_M_N', int64)] - events: - cat=1 (2 events): - timestamps: [1. 2.] - 'add_M_N': [20 40] - cat=2 (2 events): - timestamps: [3. 4.] - 'add_M_N': [60 80] - ... - - ``` - - Args: - input_1: First EventSet. - input_2: Second EventSet. - - Returns: - Sum of `input_1`'s and `input_2`'s features. - """ assert isinstance(input_1, EventSetNode) assert isinstance(input_2, EventSetNode) @@ -246,51 +106,6 @@ def subtract( input_1: EventSetOrNode, input_2: EventSetOrNode, ) -> EventSetOrNode: - """Subtracts two [`EventSets`][temporian.EventSet]. - - Each feature in `input_2` is subtracted from the feature in `input_1` in the - same position. - - `input_1` and `input_2` must have the same sampling, index, - number of features and dtype for the features in the same positions. - - Example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200]} - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f2": [10, 20, -5]}, - ... same_sampling_as=a - ... ) - - >>> # Equivalent - >>> c = tp.subtract(a, b) - >>> c = a - b - >>> c - indexes: [] - features: [('sub_f1_f2', int64)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'sub_f1_f2': [-10 80 205] - ... - - ``` - - See [`tp.add()`][temporian.add] examples to see how to match samplings, - dtypes and index, in order to apply arithmetic operators in different - EventSets. - - Args: - input_1: First EventSet. - input_2: Second EventSet. - - Returns: - Subtraction of `input_2`'s features from `input_1`'s. - """ assert isinstance(input_1, EventSetNode) assert isinstance(input_2, EventSetNode) @@ -305,51 +120,6 @@ def multiply( input_1: EventSetOrNode, input_2: EventSetOrNode, ) -> EventSetOrNode: - """Multiplies two [`EventSets`][temporian.EventSet]. - - Each feature in `input_1` is multiplied by the feature in `input_2` in the - same position. - - `input_1` and `input_2` must have the same sampling, index, - number of features and dtype for the features in the same positions. - - Example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200]} - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f2": [10, 3, 2]}, - ... same_sampling_as=a - ... ) - - >>> # Equivalent - >>> c = tp.multiply(a, b) - >>> c = a * b - >>> c - indexes: [] - features: [('mult_f1_f2', int64)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'mult_f1_f2': [ 0 300 400] - ... - - ``` - - See [`tp.add()`][temporian.add] examples to see how to match samplings, - dtypes and index, in order to apply arithmetic operators in different - EventSets. - - Args: - input_1: First EventSet. - input_2: Second EventSet. - - Returns: - Multiplication of `input_1`'s and `input_2`'s features. - """ assert isinstance(input_1, EventSetNode) assert isinstance(input_2, EventSetNode) @@ -364,87 +134,6 @@ def divide( numerator: EventSetOrNode, denominator: EventSetOrNode, ) -> EventSetOrNode: - """Divides two [`EventSets`][temporian.EventSet]. - - Each feature in `numerator` is divided by the feature in `denominator` in - the same position. - - This operator cannot be used in features with dtypes `int32` or `int64`. - Cast to float before (see example) or use the - [`tp.floordiv()`][temporian.floordiv] operator instead. - - `numerator` and `denominator` must have the same sampling, index, - number of features and dtype for the features in the same positions. - - Basic example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0.0, 100.0, 200.0]} - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f2": [10.0, 20.0, 50.0]}, - ... same_sampling_as=a - ... ) - - >>> # Equivalent - >>> c = tp.divide(a, b) - >>> c = a / b - >>> c - indexes: [] - features: [('div_f1_f2', float64)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'div_f1_f2': [0. 5. 4.] - ... - - ``` - - Casting integer features: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200]} - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f2": [10, 20, 50]}, - ... same_sampling_as=a - ... ) - - >>> # Cannot divide int64 features - >>> c = a / b - Traceback (most recent call last): - ... - ValueError: Cannot use the divide operator on feature f1 of type int64. ... - - >>> # Cast to tp.float64 or tp.float32 before - >>> c = a.cast(tp.float64) / b.cast(tp.float64) - >>> c - indexes: [] - features: [('div_f1_f2', float64)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'div_f1_f2': [0. 5. 4.] - ... - - ``` - - See [`tp.add()`][temporian.add] examples to see how to match samplings, - dtypes and index, in order to apply arithmetic operators in different - EventSets. - - - Args: - numerator: Numerator EventSet. - denominator: Denominator EventSet. - - Returns: - Division of `numerator`'s features by `denominator`'s features. - """ assert isinstance(numerator, EventSetNode) assert isinstance(denominator, EventSetNode) @@ -459,54 +148,6 @@ def floordiv( numerator: EventSetOrNode, denominator: EventSetOrNode, ) -> EventSetOrNode: - """Divides two [`EventSets`][temporian.EventSet] and takes the floor of the - result. - - I.e. computes `numerator // denominator`. - - Each feature in `numerator` is divided by the feature in `denominator` in - the same position. - - `numerator` and `denominator` must have the same sampling, index, - number of features and dtype for the features in the same positions. - - Basic example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200]} - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f2": [10, 3, 150]}, - ... same_sampling_as=a - ... ) - - >>> # Equivalent - >>> c = tp.floordiv(a, b) - >>> c = a // b - >>> c - indexes: [] - features: [('floordiv_f1_f2', int64)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'floordiv_f1_f2': [ 0 33 1] - ... - - ``` - - See [`tp.add()`][temporian.add] examples to see how to match samplings, - dtypes and index, in order to apply arithmetic operators in different - EventSets. - - Args: - numerator: Numerator EventSet. - denominator: Denominator EventSet. - - Returns: - Integer division of `numerator`'s features by `denominator`'s features. - """ assert isinstance(numerator, EventSetNode) assert isinstance(denominator, EventSetNode) @@ -521,49 +162,6 @@ def modulo( numerator: EventSetOrNode, denominator: EventSetOrNode, ) -> EventSetOrNode: - """Computes modulo or remainder of division between two - [`EventSets`][temporian.EventSet]. - - `numerator` and `denominator` must have the same sampling, index, - number of features and dtype for the features in the same positions. - - Basic example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 7, 200]} - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f2": [10, 5, 150]}, - ... same_sampling_as=a - ... ) - - >>> # Equivalent - >>> c = tp.modulo(a, b) - >>> c = a % b - >>> c - indexes: [] - features: [('mod_f1_f2', int64)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'mod_f1_f2': [ 0 2 50] - ... - - ``` - - See [`tp.add()`][temporian.add] examples to see how to match samplings, - dtypes and index, in order to apply arithmetic operators in different - EventSets. - - Args: - numerator: First EventSet. - denominator: Second EventSet. - - Returns: - New EventSet with the remainder of the integer division. - """ assert isinstance(numerator, EventSetNode) assert isinstance(denominator, EventSetNode) @@ -578,52 +176,6 @@ def power( base: EventSetOrNode, exponent: EventSetOrNode, ) -> EventSetOrNode: - """Computes elements of the base raised to the elements of the exponent - [`EventSets`][temporian.EventSet]. - - `base` and `exponent` must have the same sampling and the same number of - features. - - `base` and `exponent` must have the same sampling, index, - number of features and dtype for the features in the same positions. - - Basic example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [5, 2, 4]} - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f2": [0, 3, 2]}, - ... same_sampling_as=a - ... ) - - >>> # Equivalent - >>> c = tp.power(a, b) - >>> c = a ** b - >>> c - indexes: [] - features: [('pow_f1_f2', int64)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'pow_f1_f2': [ 1 8 16] - ... - - ``` - - See [`tp.add()`][temporian.add] examples to see how to match samplings, - dtypes and index, in order to apply arithmetic operators in different - EventSets. - - Args: - base: First EventSet. - exponent: Second EventSet. - - Returns: - New EventSet with the result of the power operation. - """ assert isinstance(base, EventSetNode) assert isinstance(exponent, EventSetNode) diff --git a/temporian/core/operators/binary/logical.py b/temporian/core/operators/binary/logical.py index 409527fc3..9e4374919 100644 --- a/temporian/core/operators/binary/logical.py +++ b/temporian/core/operators/binary/logical.py @@ -69,63 +69,6 @@ def logical_and( input_1: EventSetOrNode, input_2: EventSetOrNode, ) -> EventSetOrNode: - """Gets the logical AND (`&`) between boolean features in two - [`EventSets`][temporian.EventSet], element-wise. - - Each feature in `input_1` is compared element-wise to the feature in - `input_2` in the same position. - - `input_1` and `input_2` must have the same sampling, the same number of - features, and all feature types must be `bool` (see cast example below). - - Usage example: - ```python - >>> a = tp.event_set(timestamps=[1, 2, 3], features={"f1": [100, 150, 200]}) - - >>> # Sample boolean features - >>> b = a > 100 - >>> c = a < 200 - - >>> # Equivalent - >>> d = tp.logical_and(b, c) - >>> d = b & c - >>> d - indexes: [] - features: [('and_f1_f1', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'and_f1_f1': [False True False] - ... - - ``` - - Cast integer to boolean: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 1, 1], "f2": [1, 1, 0]} - ... ) - >>> b = a.cast(bool) - >>> c = b["f1"] & b["f2"] - >>> c - indexes: [] - features: [('and_f1_f2', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'and_f1_f2': [False True False] - ... - - ``` - - Args: - input_1: First EventSet, with only boolean features. - input_2: Second EventSet, with only boolean features. - - Returns: - EventSet with boolean features. - """ assert isinstance(input_1, EventSetNode) assert isinstance(input_2, EventSetNode) @@ -140,45 +83,6 @@ def logical_or( input_1: EventSetOrNode, input_2: EventSetOrNode, ) -> EventSetOrNode: - """Gets the logical OR (`|`) between boolean features in two - [`EventSets`][temporian.EventSet], element-wise. - - Each feature in `input_1` is compared element-wise to the feature in - `input_2` in the same position. - - `input_1` and `input_2` must have the same sampling, the same number of - features, and all feature types must be `bool` - (see cast example in [`tp.logical_and()`][temporian.logical_and]). - - Usage example: - ```python - >>> a = tp.event_set(timestamps=[1, 2, 3], features={"f1": [100, 150, 200]}) - - >>> # Sample boolean features - >>> b = a <= 100 - >>> c = a >= 200 - - >>> # Equivalent - >>> d = tp.logical_or(b, c) - >>> d = b | c - >>> d - indexes: [] - features: [('or_f1_f1', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'or_f1_f1': [ True False True] - ... - - ``` - - Args: - input_1: First EventSet, with only boolean features. - input_2: Second EventSet, with only boolean features. - - Returns: - EventSet with boolean features. - """ assert isinstance(input_1, EventSetNode) assert isinstance(input_2, EventSetNode) @@ -193,45 +97,6 @@ def logical_xor( input_1: EventSetOrNode, input_2: EventSetOrNode, ) -> EventSetOrNode: - """Gets the logical XOR (`^`) between boolean features in two - [`EventSets`][temporian.EventSet], element-wise. - - Each feature in `input_1` is compared element-wise to the feature in - `input_2` in the same position. - - `input_1` and `input_2` must have the same sampling, the same number of - features, and all feature types must be `bool` - (see cast example in [`tp.logical_and()`][temporian.logical_and]). - - Usage example: - ```python - >>> a = tp.event_set(timestamps=[1, 2, 3], features={"f1": [100, 150, 200]}) - - >>> # Sample boolean features - >>> b = a > 100 - >>> c = a < 200 - - >>> # Equivalent - >>> d = tp.logical_xor(b, c) - >>> d = b ^ c - >>> d - indexes: [] - features: [('xor_f1_f1', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'xor_f1_f1': [ True False True] - ... - - ``` - - Args: - input_1: First EventSet, with only boolean features. - input_2: Second EventSet, with only boolean features. - - Returns: - EventSet with boolean features. - """ assert isinstance(input_1, EventSetNode) assert isinstance(input_2, EventSetNode) diff --git a/temporian/core/operators/binary/relational.py b/temporian/core/operators/binary/relational.py index 2ef7587d3..faf0e72a7 100644 --- a/temporian/core/operators/binary/relational.py +++ b/temporian/core/operators/binary/relational.py @@ -20,7 +20,6 @@ from temporian.core.data.node import EventSetNode from temporian.core.data.schema import FeatureSchema from temporian.core.operators.binary.base import BaseBinaryOperator -from temporian.core.operators.scalar.relational_scalar import equal_scalar from temporian.core.typing import EventSetOrNode @@ -78,51 +77,6 @@ def equal( input_1: EventSetOrNode, input_2: EventSetOrNode, ) -> EventSetOrNode: - """Checks (element-wise) for equality between two [`EventSets`][temporian.EventSet]. - - Each feature in `input_1` is compared element-wise to the feature in - `input_2` in the same position. - Note that it will always return False on NaN elements. - - `input_1` and `input_2` must have the same sampling and the same number of - features. - - Example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200]} - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f2": [-10, 100, 5]}, - ... same_sampling_as=a - ... ) - - >>> # WARN: Don't use this for element-wise comparison - >>> a == b - False - - >>> # Element-wise comparison - >>> c = tp.equal(a, b) - >>> c - indexes: [] - features: [('eq_f1_f2', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'eq_f1_f2': [False True False] - ... - - ``` - - Args: - input_1: First EventSet. - input_2: Second EventSet. - - Returns: - Result of the comparison. - """ assert isinstance(input_1, EventSetNode) assert isinstance(input_2, EventSetNode) @@ -137,48 +91,6 @@ def not_equal( input_1: EventSetOrNode, input_2: EventSetOrNode, ) -> EventSetOrNode: - """Checks (element-wise) for differences between two [`EventSets`][temporian.EventSet]. - - Each feature in `input_1` is compared element-wise to the feature in - `input_2` in the same position. - Note that it will always return True on NaNs (even if both are). - - `input_1` and `input_2` must have the same sampling and the same number of - features. - - Example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200]} - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f2": [-10, 100, 5]}, - ... same_sampling_as=a - ... ) - - >>> # Equivalent - >>> c = tp.not_equal(a, b) - >>> c = a != b - >>> c - indexes: [] - features: [('ne_f1_f2', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'ne_f1_f2': [ True False True] - ... - - ``` - - Args: - input_1: First EventSet. - input_2: Second EventSet. - - Returns: - Result of the comparison. - """ assert isinstance(input_1, EventSetNode) assert isinstance(input_2, EventSetNode) @@ -193,48 +105,6 @@ def greater( input_left: EventSetOrNode, input_right: EventSetOrNode, ) -> EventSetOrNode: - """Checks (element-wise) if input_left > input_right. - - Each feature in `input_left` is compared element-wise to the feature in - `input_right` in the same position. - Note that it will always return False on NaN elements. - - `input_left` and `input_right` must have the same sampling and the same - number of features. - - Example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200]} - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f2": [-10, 100, 5]}, - ... same_sampling_as=a - ... ) - - >>> # Equivalent - >>> c = tp.greater(a, b) - >>> c = a > b - >>> c - indexes: [] - features: [('gt_f1_f2', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'gt_f1_f2': [ True False True] - ... - - ``` - - Args: - input_left: EventSet to the left of the operator. - input_right: EventSet to the right of the operator. - - Returns: - Result of the comparison. - """ assert isinstance(input_left, EventSetNode) assert isinstance(input_right, EventSetNode) @@ -249,48 +119,6 @@ def greater_equal( input_left: EventSetOrNode, input_right: EventSetOrNode, ) -> EventSetOrNode: - """Checks (element-wise) if input_left >= input_right. - - Each feature in `input_left` is compared element-wise to the feature in - `input_right` in the same position. - Note that it will always return False on NaN elements. - - `input_left` and `input_right` must have the same sampling and the same - number of features. - - Example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200]} - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f2": [-10, 100, 5]}, - ... same_sampling_as=a - ... ) - - >>> # Equivalent - >>> c = tp.greater_equal(a, b) - >>> c = a >= b - >>> c - indexes: [] - features: [('ge_f1_f2', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'ge_f1_f2': [ True True True] - ... - - ``` - - Args: - input_left: EventSet to the left of the operator. - input_right: EventSet to the right of the operator. - - Returns: - Result of the comparison. - """ assert isinstance(input_left, EventSetNode) assert isinstance(input_right, EventSetNode) @@ -305,48 +133,6 @@ def less( input_left: EventSetOrNode, input_right: EventSetOrNode, ) -> EventSetOrNode: - """Checks (element-wise) if input_left < input_right. - - Each feature in `input_left` is compared element-wise to the feature in - `input_right` in the same position. - Note that it will always return False on NaN elements. - - `input_left` and `input_right` must have the same sampling and the same - number of features. - - Example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200]} - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f2": [-10, 100, 5]}, - ... same_sampling_as=a - ... ) - - >>> # Equivalent - >>> c = tp.less(a, b) - >>> c = a < b - >>> c - indexes: [] - features: [('lt_f1_f2', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'lt_f1_f2': [False False False] - ... - - ``` - - Args: - input_left: EventSet to the left of the operator. - input_right: EventSet to the right of the operator. - - Returns: - Result of the comparison. - """ assert isinstance(input_left, EventSetNode) assert isinstance(input_right, EventSetNode) @@ -361,48 +147,6 @@ def less_equal( input_left: EventSetOrNode, input_right: EventSetOrNode, ) -> EventSetOrNode: - """Checks (element-wise) if input_left <= input_right. - - Each feature in `input_left` is compared element-wise to the feature in - `input_right` in the same position. - Note that it will always return False on NaN elements. - - `input_left` and `input_right` must have the same sampling and the same - number of features. - - Example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200]} - ... ) - >>> b = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f2": [-10, 100, 5]}, - ... same_sampling_as=a - ... ) - - >>> # Equivalent - >>> c = tp.less_equal(a, b) - >>> c = a <= b - >>> c - indexes: [] - features: [('le_f1_f2', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'le_f1_f2': [False True False] - ... - - ``` - - Args: - input_left: EventSet to the left of the operator. - input_right: EventSet to the right of the operator. - - Returns: - Result of the comparison. - """ assert isinstance(input_left, EventSetNode) assert isinstance(input_right, EventSetNode) diff --git a/temporian/core/operators/scalar/arithmetic_scalar.py b/temporian/core/operators/scalar/arithmetic_scalar.py index eff25d51d..8a471b992 100644 --- a/temporian/core/operators/scalar/arithmetic_scalar.py +++ b/temporian/core/operators/scalar/arithmetic_scalar.py @@ -77,36 +77,6 @@ def add_scalar( input: EventSetOrNode, value: Union[float, int], ) -> EventSetOrNode: - """Adds a scalar value to an [`EventSet`][temporian.EventSet]. - - `value` is added to each item in each feature in `input`. - - Usage example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200], "f2": [10, -10, 5]} - ... ) - - >>> # Equivalent - >>> b = tp.add_scalar(a, 3) - >>> b = a + 3 - >>> b - indexes: ... - timestamps: [1. 2. 3.] - 'f1': [ 3 103 203] - 'f2': [13 -7 8] - ... - - ``` - - Args: - input: EventSetNode to add a scalar to. - value: Scalar value to add to the input. - - Returns: - Addition of `input` and `value`. - """ assert isinstance(input, EventSetNode) return AddScalarOperator( @@ -120,51 +90,6 @@ def subtract_scalar( minuend: Union[EventSetOrNode, SCALAR], subtrahend: Union[EventSetOrNode, SCALAR], ) -> EventSetOrNode: - """Subtracts an [`EventSet`][temporian.EventSet] and a scalar value. - - Each item in each feature in the EventSet is subtracted with the scalar - value. - - Either `minuend` or `subtrahend` should be a scalar value, but not both. If - looking to subtract two EventSets, use the - [`tp.subtract()`][temporian.subtract] operator instead. - - Usage example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200], "f2": [10, -10, 5]} - ... ) - - >>> # Equivalent - >>> b = tp.subtract_scalar(a, 3) - >>> b = a - 3 - >>> b - indexes: ... - timestamps: [1. 2. 3.] - 'f1': [ -3 97 197] - 'f2': [ 7 -13 2] - ... - - >>> # Equivalent - >>> c = tp.subtract_scalar(3, a) - >>> c = 3 - a - >>> c - indexes: ... - timestamps: [1. 2. 3.] - 'f1': [ 3 -97 -197] - 'f2': [-7 13 -2] - ... - - ``` - - Args: - minuend: EventSet or scalar value being subtracted from. - subtrahend: EventSet or scalar number being subtracted. - - Returns: - EventSet with the difference between the minuend and subtrahend. - """ scalars_types = (float, int) if isinstance(minuend, EventSetNode) and isinstance( @@ -201,36 +126,6 @@ def multiply_scalar( input: EventSetOrNode, value: Union[float, int], ) -> EventSetOrNode: - """Multiplies an [`EventSet`][temporian.EventSet] by a scalar value. - - Each item in each feature in `input` is multiplied by `value`. - - Usage example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200], "f2": [10, -10, 5]} - ... ) - - >>> # Equivalent - >>> b = tp.multiply_scalar(a, 2) - >>> b = a * 2 - >>> b - indexes: ... - timestamps: [1. 2. 3.] - 'f1': [ 0 200 400] - 'f2': [ 20 -20 10] - ... - - ``` - - Args: - input: EventSet to multiply. - value: Scalar value to multiply the input by. - - Returns: - Integer division of `input` and `value`. - """ assert isinstance(input, EventSetNode) return MultiplyScalarOperator( @@ -244,50 +139,6 @@ def divide_scalar( numerator: Union[EventSetOrNode, SCALAR], denominator: Union[EventSetOrNode, SCALAR], ) -> EventSetOrNode: - """Divides an [`EventSet`][temporian.EventSet] and a scalar value. - - Each item in each feature in the EventSet is divided with the scalar value. - - Either `numerator` or `denominator` should be a scalar value, but not both. - If looking to divide two EventSets, use the - [`tp.divide()`][temporian.divide] operator instead. - - Usage example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0., 100., 200.], "f2": [10., -10., 5.]} - ... ) - - >>> # Equivalent - >>> b = tp.divide_scalar(a, 2) - >>> b = a / 2 - >>> b - indexes: ... - timestamps: [1. 2. 3.] - 'f1': [ 0. 50. 100.] - 'f2': [ 5. -5. 2.5] - ... - - >>> # Equivalent - >>> c = tp.divide_scalar(1000, a) - >>> c = 1000 / a - >>> c - indexes: ... - timestamps: [1. 2. 3.] - 'f1': [inf 10. 5.] - 'f2': [ 100. -100. 200.] - ... - - ``` - - Args: - numerator: Numerator EventSet or value. - denominator: Denominator EventSet or value. - - Returns: - Division of `numerator` and `denominator`. - """ scalars_types = (float, int) if isinstance(numerator, EventSetNode) and isinstance( @@ -324,51 +175,6 @@ def floordiv_scalar( numerator: Union[EventSetOrNode, SCALAR], denominator: Union[EventSetOrNode, SCALAR], ) -> EventSetOrNode: - """Divides an [`EventSet`][temporian.EventSet] and a scalar and takes the - result's floor. - - Each item in each feature in the EventSet is divided with the scalar value. - - Either `numerator` or `denominator` should be a scalar value, but not both. - If looking to floordiv two EventSet, use the - [`tp.floordiv()`][temporian.floordiv] operator instead. - - Usage example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [1, 100, 200], "f2": [10., -10., 5.]} - ... ) - - >>> # Equivalent - >>> b = tp.floordiv_scalar(a, 3) - >>> b = a // 3 - >>> b - indexes: ... - timestamps: [1. 2. 3.] - 'f1': [ 0 33 66] - 'f2': [ 3. -4. 1.] - ... - - >>> # Equivalent - >>> c = tp.floordiv_scalar(300, a) - >>> c = 300 // a - >>> c - indexes: ... - timestamps: [1. 2. 3.] - 'f1': [300 3 1] - 'f2': [ 30. -30. 60.] - ... - - ``` - - Args: - numerator: Numerator EventSet or value. - denominator: Denominator EventSet or value. - - Returns: - Integer division of `numerator` and `denominator`. - """ scalars_types = (float, int) if isinstance(numerator, EventSetNode) and isinstance( @@ -405,49 +211,6 @@ def modulo_scalar( numerator: Union[EventSetOrNode, SCALAR], denominator: Union[EventSetOrNode, SCALAR], ) -> EventSetOrNode: - """Remainder of the division of numerator by denominator - [`EventSets`][temporian.EventSet]. - - Either `numerator` or `denominator` should be a scalar value, but not both. - For the operation between two EventSets, use the - [`tp.modulo()`][temporian.modulo] operator instead. - - Usage example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [1, 100, 200], "f2": [10., -10., 5.]} - ... ) - - >>> # Equivalent - >>> b = tp.modulo_scalar(a, 3) - >>> b = a % 3 - >>> b - indexes: ... - timestamps: [1. 2. 3.] - 'f1': [1 1 2] - 'f2': [1. 2. 2.] - ... - - >>> # Equivalent - >>> c = tp.floordiv_scalar(300, a) - >>> c = 300 % a - >>> c - indexes: ... - timestamps: [1. 2. 3.] - 'f1': [ 0 0 100] - 'f2': [ 0. -0. 0.] - ... - - ``` - - Args: - numerator: EventSet or scalar to divide. - denominator: EventSet or scalar to divide by. - - Returns: - Remainder of the integer division. - """ scalar_types = (float, int) if isinstance(numerator, EventSetNode) and isinstance( @@ -484,49 +247,6 @@ def power_scalar( base: Union[EventSetOrNode, SCALAR], exponent: Union[EventSetOrNode, SCALAR], ) -> EventSetOrNode: - """Raise the base to the exponent (`base ** exponent`) - [`EventSets`][temporian.EventSet]. - - Either `base` or `exponent` should be a scalar value, but not both. - For the operation between two EventSets, use the - [`tp.power()`][temporian.power] operator instead. - - Usage example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 2, 3], "f2": [1., 2., 3.]} - ... ) - - >>> # Equivalent - >>> b = tp.power_scalar(a, 3) - >>> b = a ** 3 - >>> b - indexes: ... - timestamps: [1. 2. 3.] - 'f1': [ 0 8 27] - 'f2': [ 1. 8. 27.] - ... - - >>> # Equivalent - >>> c = tp.power_scalar(3, a) - >>> c = 3 ** a - >>> c - indexes: ... - timestamps: [1. 2. 3.] - 'f1': [ 1 9 27] - 'f2': [ 3. 9. 27.] - ... - - ``` - - Args: - base: EventSet or scalar to raise to the exponent. - exponent: EventSet or scalar for the exponent. - - Returns: - Base values raised to the exponent. - """ scalar_types = (float, int) if isinstance(base, EventSetNode) and isinstance(exponent, scalar_types): diff --git a/temporian/core/operators/scalar/relational_scalar.py b/temporian/core/operators/scalar/relational_scalar.py index 28561d98e..c77fe7a49 100644 --- a/temporian/core/operators/scalar/relational_scalar.py +++ b/temporian/core/operators/scalar/relational_scalar.py @@ -79,44 +79,6 @@ def equal_scalar( input: EventSetOrNode, value: Union[float, int, str, bool, bytes], ) -> EventSetOrNode: - """Checks for equality between an [`EventSet`][temporian.EventSet] and a - scalar element-wise. - - Each item in each feature in `input` is compared to `value`. - Note that if both elements are NaNs, returns False. - - Usage example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200], "f2": [-10, 100, 5]} - ... ) - - >>> # WARN: Don't use this for element-wise comparison - >>> a == 100 - False - - >>> # Element-wise comparison - >>> b = tp.equal_scalar(a, 100) - >>> b - indexes: [] - features: [('f1', bool_), ('f2', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'f1': [False True False] - 'f2': [False True False] - ... - - ``` - - Args: - input: EventSet to compare the value to. - value: Scalar value to compare to the input. - - Returns: - EventSet containing the result of the comparison. - """ assert isinstance(input, EventSetNode) return EqualScalarOperator( @@ -130,41 +92,6 @@ def not_equal_scalar( input: EventSetOrNode, value: Union[float, int, str, bytes, bool], ) -> EventSetOrNode: - """Checks for differences between an [`EventSet`][temporian.EventSet] and a - scalar element-wise. - - Each item in each feature in `input` is compared to `value`. - Note that if both elements are NaNs, returns True. - - Usage example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200], "f2": [-10, 100, 5]} - ... ) - - >>> # Equivalent - >>> b = tp.not_equal_scalar(a, 100) - >>> b = a != 100 - >>> b - indexes: [] - features: [('f1', bool_), ('f2', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'f1': [ True False True] - 'f2': [ True False True] - ... - - ``` - - Args: - input: EventSet to compare the value to. - value: Scalar value to compare to the input. - - Returns: - EventSet containing the result of the comparison. - """ assert isinstance(input, EventSetNode) return NotEqualScalarOperator( @@ -178,41 +105,6 @@ def greater_equal_scalar( input: EventSetOrNode, value: Union[float, int, str, bytes, bool], ) -> EventSetOrNode: - """Check if the input [`EventSet`][temporian.EventSet] is greater or equal - than a scalar element-wise. - - Each item in each feature in `input` is compared to `value`. - Note that it will always return False on NaN elements. - - Usage example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200], "f2": [-10, 100, 5]} - ... ) - - >>> # Equivalent - >>> b = tp.greater_equal_scalar(a, 100) - >>> b = a >= 100 - >>> b - indexes: [] - features: [('f1', bool_), ('f2', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'f1': [False True True] - 'f2': [False True False] - ... - - ``` - - Args: - input: EventSet to compare the value to. - value: Scalar value to compare to the input. - - Returns: - EventSet containing the result of the comparison. - """ assert isinstance(input, EventSetNode) return GreaterEqualScalarOperator( @@ -226,41 +118,6 @@ def less_equal_scalar( input: EventSetOrNode, value: Union[float, int, str, bytes, bool], ) -> EventSetOrNode: - """Check if the input [`EventSet`][temporian.EventSet] is less or equal than - a scalar element-wise. - - Each item in each feature in `input` is compared to `value`. - Note that it will always return False on NaN elements. - - Usage example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200], "f2": [-10, 100, 5]} - ... ) - - >>> # Equivalent - >>> b = tp.less_equal_scalar(a, 100) - >>> b = a <= 100 - >>> b - indexes: [] - features: [('f1', bool_), ('f2', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'f1': [ True True False] - 'f2': [ True True True] - ... - - ``` - - Args: - input: EventSet to compare the value to. - value: Scalar value to compare to the input. - - Returns: - EventSet containing the result of the comparison. - """ assert isinstance(input, EventSetNode) return LessEqualScalarOperator( @@ -274,41 +131,6 @@ def greater_scalar( input: EventSetOrNode, value: Union[float, int, str, bytes, bool], ) -> EventSetOrNode: - """Check if the input [`EventSet`][temporian.EventSet] is greater than a - scalar element-wise. - - Each item in each feature in `input` is compared to `value`. - Note that it will always return False on NaN elements. - - Usage example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200], "f2": [-10, 100, 5]} - ... ) - - >>> # Equivalent - >>> b = tp.greater_scalar(a, 100) - >>> b = a > 100 - >>> b - indexes: [] - features: [('f1', bool_), ('f2', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'f1': [False False True] - 'f2': [False False False] - ... - - ``` - - Args: - input: EventSet to compare the value to. - value: Scalar value to compare to the input. - - Returns: - EventSet containing the result of the comparison. - """ assert isinstance(input, EventSetNode) return GreaterScalarOperator( @@ -322,41 +144,6 @@ def less_scalar( input: EventSetOrNode, value: Union[float, int, str, bytes, bool], ) -> EventSetOrNode: - """Check if the input [`EventSet`][temporian.EventSet] is less than a scalar - element-wise. - - Each item in each feature in `input` is compared to `value`. - Note that it will always return False on NaN elements. - - Usage example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2, 3], - ... features={"f1": [0, 100, 200], "f2": [-10, 100, 5]} - ... ) - - >>> # Equivalent - >>> b = tp.less_scalar(a, 100) - >>> b = a < 100 - >>> b - indexes: [] - features: [('f1', bool_), ('f2', bool_)] - events: - (3 events): - timestamps: [1. 2. 3.] - 'f1': [ True False False] - 'f2': [ True False True] - ... - - ``` - - Args: - input: EventSet to compare the value to. - value: Scalar value to compare to the input. - - Returns: - EventSet containing the result of the comparison. - """ assert isinstance(input, EventSetNode) return LessScalarOperator( diff --git a/temporian/core/operators/unary.py b/temporian/core/operators/unary.py index 2a8b968fa..bd3313c56 100644 --- a/temporian/core/operators/unary.py +++ b/temporian/core/operators/unary.py @@ -193,44 +193,6 @@ def get_output_dtype(cls, feature_dtype: DType) -> DType: def invert( input: EventSetOrNode, ) -> EventSetOrNode: - """Inverts a boolean [`EventSet`][temporian.EventSet] (~EventSet). - - Swaps False <-> True element-wise. - - Does not work on integers, they should be cast to - [`tp.bool_`][temporian.bool_] beforehand, using - [`EventSet.cast()`][temporian.EventSet.cast]. - - Example: - ```python - >>> a = tp.event_set( - ... timestamps=[1, 2], - ... features={"M": [1, 5], "N": [1.0, 5.5]}, - ... ) - >>> # Boolean node - >>> b = a < 2 - >>> b - indexes: ... - 'M': [ True False] - 'N': [ True False] - ... - - >>> # Inverted node - >>> c = ~b - >>> c - indexes: ... - 'M': [False True] - 'N': [False True] - ... - - ``` - - Args: - input: EventSet to invert. - - Returns: - Inverted EventSet. - """ assert isinstance(input, EventSetNode) return InvertOperator( From a4d375c8dcc143e1c562f691c73e64692215e1c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Braulio=20R=C3=ADos?= Date: Wed, 1 Nov 2023 11:17:10 -0300 Subject: [PATCH 4/4] Remove explicit dark theme (mkdocs-jupyter) --- docs/mkdocs.yml | 1 - docs/src/reference/index.md | 84 ++++++++++++++++++------------------- 2 files changed, 41 insertions(+), 44 deletions(-) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 465485c58..45ce66c92 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -101,7 +101,6 @@ plugins: include: ["*.ipynb"] # Use ["*.py", "*.ipynb"] to render jupytext too. ignore: ["**/.ipynb_checkpoints/*"] allow_errors: false # Cancel build if cell execution fails. - theme: dark # Configuration to generate the reference pages from the docstrings. - mkdocstrings: default_handler: python diff --git a/docs/src/reference/index.md b/docs/src/reference/index.md index 6e24dd3e3..2dfc04575 100644 --- a/docs/src/reference/index.md +++ b/docs/src/reference/index.md @@ -36,46 +36,44 @@ Check the index on the left for a more detailed description of any symbol. | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | [`tp.duration.milliseconds()`][temporian.duration.milliseconds] [`tp.duration.seconds()`][temporian.duration.seconds] [`tp.duration.minutes()`][temporian.duration.minutes] [`tp.duration.hours()`][temporian.duration.hours] [`tp.duration.days()`][temporian.duration.days] [`tp.duration.weeks()`][temporian.duration.weeks] | Convert input value from milliseconds / seconds / minutes / hours / days / weeks to a `Duration` in seconds. | - ## Operators -| Symbols | Description | -| ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | -| [`tp.combine()`][temporian.combine] | Combines events from [`EventSets`][temporian.EventSet] with different samplings. | -| [`tp.glue()`][temporian.glue] | Concatenates features from [`EventSets`][temporian.EventSet] with the same sampling. | -| [`EventSet.abs()`][temporian.EventSet.abs] | Computes the absolute value of the features. | -| [`EventSet.add_index()`][temporian.EventSet.add_index] | Adds indexes to an [`EventSet`][temporian.EventSet]. | -| [`EventSet.begin()`][temporian.EventSet.begin] | Generates a single timestamp at the beginning of the input. | -| [`EventSet.cast()`][temporian.EventSet.cast] | Casts the dtype of features. | -| [`EventSet.drop_index()`][temporian.EventSet.drop_index] | Removes indexes from an [`EventSet`][temporian.EventSet]. | -| [`EventSet.end()`][temporian.EventSet.end] | Generates a single timestamp at the end of the input. | -| [`EventSet.enumerate()`][temporian.EventSet.enumerate] | Creates an ordinal feature enumerating the events according to their timestamp. | -| [`EventSet.equal()`][temporian.EventSet.equal] | Creates boolean features with event-wise equality to another `EventSet` or to a scalar value. | -| [`EventSet.experimental_fast_fourier_transform()`][temporian.EventSet.experimental_fast_fourier_transform] | Applies a Fast Fourier Transform. | -| [`EventSet.filter()`][temporian.EventSet.filter] | Filters out events in an [`EventSet`][temporian.EventSet] for which a condition is false. | -| [`EventSet.filter_moving_count()`][temporian.EventSet.filter_moving_count] | Skips events such that no more than one event is within a time window of `window_length`. | -| [`EventSet.isnan()`][temporian.EventSet.isnan] | Event-wise boolean that is `True` in the `NaN` positions of the input events. Equivalent to `~evset.notnan()`. | -| [`EventSet.join()`][temporian.EventSet.join] | Joins [`EventSets`][temporian.EventSet] with different samplings but the same index together. | -| [`EventSet.lag()`][temporian.EventSet.lag] | Adds a delay to an [`EventSet`][temporian.EventSet]'s timestamps. | -| [`EventSet.leak()`][temporian.EventSet.leak] | Subtracts a duration from an [`EventSet`][temporian.EventSet]'s timestamps. | -| [`EventSet.log()`][temporian.EventSet.log] | Computes natural logarithm of the features | -| [`EventSet.map()`][temporian.EventSet.map] | Applies a function on each of an [`EventSet`][temporian.EventSet]'s values. | -| [`EventSet.notnan()`][temporian.EventSet.notnan] | Event-wise boolean that is `True` if the input values are not `NaN`. Equivalent to `~evset.isnan()`. | -| [`EventSet.prefix()`][temporian.EventSet.prefix] | Adds a prefix to the names of the features in an [`EventSet`][temporian.EventSet]. | -| [`EventSet.propagate()`][temporian.EventSet.propagate] | Propagates feature values over a sub index. | -| [`EventSet.rename()`][temporian.EventSet.rename] | Renames an [`EventSet`][temporian.EventSet]'s features and index. | -| [`EventSet.resample()`][temporian.EventSet.resample] | Resamples an [`EventSet`][temporian.EventSet] at each timestamp of another [`EventSet`][temporian.EventSet]. | -| [`EventSet.select()`][temporian.EventSet.select] | Selects a subset of features from an [`EventSet`][temporian.EventSet]. | -| [`EventSet.select_index_values()`][temporian.EventSet.select_index_values] | Selects a subset of index values from an [`EventSet`][temporian.EventSet]. | -| [`EventSet.set_index()`][temporian.EventSet.set_index] | Replaces the indexes in an [`EventSet`][temporian.EventSet]. | -| [`EventSet.since_last()`][temporian.EventSet.since_last] | Computes the amount of time since the last distinct timestamp. | -| [`EventSet.tick()`][temporian.EventSet.tick] | Generates timestamps at regular intervals in the range of a guide. | -| [`EventSet.tick_calendar()`][temporian.EventSet.tick] | Generates timestamps at the specified calendar date-time events. | -| [`EventSet.timestamps()`][temporian.EventSet.timestamps] | Creates a feature from the events timestamps (`float64`). | -| [`EventSet.unique_timestamps()`][temporian.EventSet.unique_timestamps] | Removes events with duplicated timestamps from an [`EventSet`][temporian.EventSet]. | -| [`EventSet.until_next()`][temporian.EventSet.until_next] | Duration until the next sampling event. | -| [`EventSet.where()`][temporian.EventSet.where] | Choose events from two possible sources, based on boolean conditions. | - +| Symbols | Description | +| ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| [`tp.combine()`][temporian.combine] | Combines events from [`EventSets`][temporian.EventSet] with different samplings. | +| [`tp.glue()`][temporian.glue] | Concatenates features from [`EventSets`][temporian.EventSet] with the same sampling. | +| [`EventSet.abs()`][temporian.EventSet.abs] | Computes the absolute value of the features. | +| [`EventSet.add_index()`][temporian.EventSet.add_index] | Adds indexes to an [`EventSet`][temporian.EventSet]. | +| [`EventSet.begin()`][temporian.EventSet.begin] | Generates a single timestamp at the beginning of the input. | +| [`EventSet.cast()`][temporian.EventSet.cast] | Casts the dtype of features. | +| [`EventSet.drop_index()`][temporian.EventSet.drop_index] | Removes indexes from an [`EventSet`][temporian.EventSet]. | +| [`EventSet.end()`][temporian.EventSet.end] | Generates a single timestamp at the end of the input. | +| [`EventSet.enumerate()`][temporian.EventSet.enumerate] | Creates an ordinal feature enumerating the events according to their timestamp. | +| [`EventSet.equal()`][temporian.EventSet.equal] | Creates boolean features with event-wise equality to another `EventSet` or to a scalar value. | +| [`EventSet.experimental_fast_fourier_transform()`][temporian.EventSet.experimental_fast_fourier_transform] | Applies a Fast Fourier Transform. | +| [`EventSet.filter()`][temporian.EventSet.filter] | Filters out events in an [`EventSet`][temporian.EventSet] for which a condition is false. | +| [`EventSet.filter_moving_count()`][temporian.EventSet.filter_moving_count] | Skips events such that no more than one event is within a time window of `window_length`. | +| [`EventSet.isnan()`][temporian.EventSet.isnan] | Event-wise boolean that is `True` in the `NaN` positions of the input events. Equivalent to `~evset.notnan()`. | +| [`EventSet.join()`][temporian.EventSet.join] | Joins [`EventSets`][temporian.EventSet] with different samplings but the same index together. | +| [`EventSet.lag()`][temporian.EventSet.lag] | Adds a delay to an [`EventSet`][temporian.EventSet]'s timestamps. | +| [`EventSet.leak()`][temporian.EventSet.leak] | Subtracts a duration from an [`EventSet`][temporian.EventSet]'s timestamps. | +| [`EventSet.log()`][temporian.EventSet.log] | Computes natural logarithm of the features | +| [`EventSet.map()`][temporian.EventSet.map] | Applies a function on each of an [`EventSet`][temporian.EventSet]'s values. | +| [`EventSet.notnan()`][temporian.EventSet.notnan] | Event-wise boolean that is `True` if the input values are not `NaN`. Equivalent to `~evset.isnan()`. | +| [`EventSet.prefix()`][temporian.EventSet.prefix] | Adds a prefix to the names of the features in an [`EventSet`][temporian.EventSet]. | +| [`EventSet.propagate()`][temporian.EventSet.propagate] | Propagates feature values over a sub index. | +| [`EventSet.rename()`][temporian.EventSet.rename] | Renames an [`EventSet`][temporian.EventSet]'s features and index. | +| [`EventSet.resample()`][temporian.EventSet.resample] | Resamples an [`EventSet`][temporian.EventSet] at each timestamp of another [`EventSet`][temporian.EventSet]. | +| [`EventSet.select()`][temporian.EventSet.select] | Selects a subset of features from an [`EventSet`][temporian.EventSet]. | +| [`EventSet.select_index_values()`][temporian.EventSet.select_index_values] | Selects a subset of index values from an [`EventSet`][temporian.EventSet]. | +| [`EventSet.set_index()`][temporian.EventSet.set_index] | Replaces the indexes in an [`EventSet`][temporian.EventSet]. | +| [`EventSet.since_last()`][temporian.EventSet.since_last] | Computes the amount of time since the last distinct timestamp. | +| [`EventSet.tick()`][temporian.EventSet.tick] | Generates timestamps at regular intervals in the range of a guide. | +| [`EventSet.tick_calendar()`][temporian.EventSet.tick] | Generates timestamps at the specified calendar date-time events. | +| [`EventSet.timestamps()`][temporian.EventSet.timestamps] | Creates a feature from the events timestamps (`float64`). | +| [`EventSet.unique_timestamps()`][temporian.EventSet.unique_timestamps] | Removes events with duplicated timestamps from an [`EventSet`][temporian.EventSet]. | +| [`EventSet.until_next()`][temporian.EventSet.until_next] | Duration until the next sampling event. | +| [`EventSet.where()`][temporian.EventSet.where] | Choose events from two possible sources, based on boolean conditions. | ### Calendar operators @@ -91,8 +89,8 @@ Check the index on the left for a more detailed description of any symbol. ### Python operators -| Symbols | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `+` (add), `-` (subtract), `\*` (multiply), `/` (divide), `//` (floor divide), `%` (modulo), `**` (power) | Event-wise arithmetic operations between two `EventSets` or with a scalar number. See the corresponding [User Guide section](../user_guide#arithmetic-operators) for more info. | -| `!=` (not equal), `>` (greater than), `>=` (greater or equal), `<` (less), `<=` (less or equal) | Event-wise comparison between `EventSets` or to a scalar number. Note that `==` is not supported, use `EventSet.equal()` instead. See the [User Guide](../user_guide#comparisons) for more info. | -| `&` (and), `\|` (or), `^` (xor) | Event-wise logic operators between boolean `EventSets`. | \ No newline at end of file +| Symbols | Description | +| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `+` (add), `-` (subtract), `\*` (multiply), `/` (divide), `//` (floor divide), `%` (modulo), `**` (power) | Event-wise arithmetic operations between two `EventSets` or with a scalar number. See the corresponding [User Guide section](../user_guide#arithmetic-operators) for more info. | +| `!=` (not equal), `>` (greater than), `>=` (greater or equal), `<` (less), `<=` (less or equal) | Event-wise comparison between `EventSets` or to a scalar number. Note that `==` is not supported, use `EventSet.equal()` instead. See the [User Guide](../user_guide#comparisons) for more info. | +| `&` (and), `\|` (or), `^` (xor) | Event-wise logic operators between boolean `EventSets`. |