We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c85b98 commit 7dd2e6aCopy full SHA for 7dd2e6a
solution/0100-0199/0177.Nth Highest Salary/Solution.py
@@ -2,6 +2,8 @@
2
3
4
def nth_highest_salary(employee: pd.DataFrame, N: int) -> pd.DataFrame:
5
+ if N < 1:
6
+ return pd.DataFrame({"getNthHighestSalary(" + str(N) + ")": [None]})
7
unique_salaries = employee.salary.unique()
8
if len(unique_salaries) < N:
9
return pd.DataFrame([np.NaN], columns=[f"getNthHighestSalary({N})"])
0 commit comments