Skip to content

Commit cd48685

Browse files
committed
DOC: Altered comment to format as docstring
Comment in Irr selection logic was altered to be formated as a docstring. An example was included in the documentation containing a 2D-array input.
1 parent 18d23f9 commit cd48685

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

numpy_financial/_financial.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,8 @@ def rate(
709709
return rn
710710

711711

712-
# default selection logic for IRR function when there are > 2 real solutions
713712
def _irr_default_selection(eirr):
713+
""" default selection logic for IRR function when there are > 1 real solutions """
714714
# check sign of all IRR solutions
715715
same_sign = np.all(eirr > 0) if eirr[0] > 0 else np.all(eirr < 0)
716716

@@ -801,7 +801,9 @@ def irr(values, *, raise_exceptions=False, selection_logic=_irr_default_selectio
801801
0.06206
802802
>>> round(npf.irr([-5, 10.5, 1, -8, 1]), 5)
803803
0.0886
804-
804+
>>> npf.irr([[-100, 0, 0, 74], [-100, 100, 0, 7]]).round(5)
805+
array([-0.0955 , 0.06206])
806+
805807
"""
806808
values = np.atleast_2d(values)
807809
if values.ndim not in [1, 2]:

0 commit comments

Comments
 (0)