Skip to content

Commit cadd12f

Browse files
authoredAug 7, 2022
[BUG] Force softmax returning Series (pyjanitor-devs#1139)
1 parent 76e7228 commit cadd12f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 

‎CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- [ENH] Add `names_expand` and `index_expand` parameters to `pivot_wider` for exposing missing categoricals. Issue #1108 @samukweku
1515
- [ENH] Add fix for slicing error when selecting columns in `pivot_wider`. Issue #1134 @samukweku
1616
- [ENH] `dropna` parameter added to `pivot_longer`. Issue #1132 @samukweku
17+
- [BUG] Force `math.softmax` returning `Series`. PR #1139 @Zeroto521
1718

1819
## [v0.23.1] - 2022-05-03
1920

‎janitor/math.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ def softmax(s: pd.Series) -> pd.Series:
124124
:param s: Input Series.
125125
:return: Transformed Series.
126126
"""
127-
return scipy_softmax(s)
127+
128+
return pd.Series(scipy_softmax(s), index=s.index, name=s.name)
128129

129130

130131
@pf.register_series_method

0 commit comments

Comments
 (0)
Please sign in to comment.