Skip to content

Commit 26dfe00

Browse files
committed
added value error on incorrect na_option
1 parent a439472 commit 26dfe00

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/generic.py

+4
Original file line numberDiff line numberDiff line change
@@ -7480,6 +7480,10 @@ def rank(self, axis=0, method='average', numeric_only=None,
74807480
msg = "rank does not make sense when ndim > 2"
74817481
raise NotImplementedError(msg)
74827482

7483+
if na_option not in {'keep', 'top', 'bottom'}:
7484+
msg = "na_option must be one of 'keep', 'top', or 'bottom'"
7485+
raise ValueError(msg)
7486+
74837487
def ranker(data):
74847488
ranks = algos.rank(data.values, axis=axis, method=method,
74857489
ascending=ascending, na_option=na_option,

0 commit comments

Comments
 (0)