Skip to content

Commit ee8328a

Browse files
author
Dave Reed
authored
Update SubtractNumeric Primitive with commutative class property (#2527)
* initial commit * added doc * updated release notes * Update subtract_numeric.py * lint fix
1 parent c297062 commit ee8328a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/source/release_notes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ Future Release
1515
* Fixes
1616
* Pin github-action-check-linked-issues to 1.4.5 (:pr:`2497`)
1717
* Support Woodwork's update numeric inference (integers as strings) (:pr:`2505`)
18+
* Update SubtractNumeric Primitive with commutative class property (:pr:`2527`)
1819
* Changes
1920
* Separate Makefile command for core requirements, test requirements and dev requirements (:pr:`2518`)
2021
* Documentation Changes
2122
* Testing Changes
2223

2324
Thanks to the following people for contributing to this release:
24-
:user:`gsheni`
25+
:user:`dvreed77`, :user:`gsheni`
2526

2627
v1.23.0 Feb 15, 2023
2728
====================

featuretools/primitives/standard/transform/binary/subtract_numeric.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ class SubtractNumeric(TransformPrimitive):
1818
generate both x - y and y - x, or just one. If True, there is no
1919
guarantee which of the two will be generated. Defaults to True.
2020
21+
Notes:
22+
commutative is True by default since False would result in 2 perfectly
23+
correlated series.
24+
2125
Examples:
2226
>>> subtract_numeric = SubtractNumeric()
2327
>>> subtract_numeric([2, 1, 2], [1, 2, 2]).tolist()
@@ -32,6 +36,7 @@ class SubtractNumeric(TransformPrimitive):
3236
return_type = ColumnSchema(semantic_tags={"numeric"})
3337
compatibility = [Library.PANDAS, Library.DASK]
3438
description_template = "the result of {} minus {}"
39+
commutative = True
3540

3641
def __init__(self, commutative=True):
3742
self.commutative = commutative

0 commit comments

Comments
 (0)