Skip to content

Commit a00ab5f

Browse files
authored
ENH: irr: Compare dimensions only to two
We only need to check the 2d case. As this will never be a 1d array as ``np.atleast_2d`` was used.
1 parent cd48685 commit a00ab5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

numpy_financial/_financial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ def irr(values, *, raise_exceptions=False, selection_logic=_irr_default_selectio
806806
807807
"""
808808
values = np.atleast_2d(values)
809-
if values.ndim not in [1, 2]:
809+
if values.ndim != 2:
810810
raise ValueError("Cashflows must be a 2D array")
811811

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

0 commit comments

Comments
 (0)