From a00ab5f0443d2f1c52875b70f19f334c73a17729 Mon Sep 17 00:00:00 2001 From: Kai Date: Tue, 7 May 2024 12:55:34 +0800 Subject: [PATCH] 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. --- numpy_financial/_financial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numpy_financial/_financial.py b/numpy_financial/_financial.py index 792d370..c5cd231 100644 --- a/numpy_financial/_financial.py +++ b/numpy_financial/_financial.py @@ -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])