Skip to content

Commit

Permalink
Fix formula summing for change in Numpy sum
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-brett committed Jan 2, 2023
1 parent 9d1f8d8 commit aaae2a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nipy/algorithms/statistics/formula/formulae.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,10 @@ def fromrec(rec, keep=[], drop=[]):
for d in drop:
del(f[d])
if keep:
return np.sum([t for n, t in f.items() if n in keep])
elements = [t for n, t in f.items() if n in keep]
else:
return np.sum(list(f.values()))
elements = f.values()
return sum(elements, start=Formula([]))

def subs(self, old, new):
""" Perform a sympy substitution on all terms in the Formula
Expand Down

0 comments on commit aaae2a3

Please sign in to comment.