Skip to content

Commit

Permalink
ENH: irr: Compare dimensions only to two
Browse files Browse the repository at this point in the history
We only need to check the 2d case. As this will never be a 1d array as ``np.atleast_2d`` was used.
  • Loading branch information
Kai-Striega committed May 7, 2024
1 parent cd48685 commit a00ab5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion numpy_financial/_financial.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ def irr(values, *, raise_exceptions=False, selection_logic=_irr_default_selectio
"""
values = np.atleast_2d(values)
if values.ndim not in [1, 2]:
if values.ndim != 2:
raise ValueError("Cashflows must be a 2D array")

irr_results = np.empty(values.shape[0])
Expand Down

0 comments on commit a00ab5f

Please sign in to comment.