Skip to content

Commit

Permalink
Use keepdims with scipy mode to preserve indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Feb 7, 2024
1 parent cd51b26 commit 17e42b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion matminer/featurizers/utils/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def mode(data_lst, weights=None):
mode
"""
if weights is None:
return scipy.stats.mode(data_lst).mode[0]
return scipy.stats.mode(data_lst, keepdims=True).mode[0]
else:
# Find the entry(s) with the largest weight
data_lst = np.array(data_lst)
Expand Down

0 comments on commit 17e42b5

Please sign in to comment.