Menu

Ranking USAJOBS salaries in Python without mixing hourly and annual pay
📰

Ranking USAJOBS salaries in Python without mixing hourly and annual pay

DEV Community: sql·Dataspryva·6 days ago
#UQkc3nMB
#devtosql#devto#dev#name#salarymin
Long article (1969 words) — no AI summary yet.
Reading 0:00
15s threshold

You're about to send the salary ranking, and sort_values("salaryMin") has made the spreadsheet look reassuringly tidy.

There's a catch: salaryMin and salaryMax retain the posting's stated unit, while salaryCurrency and salaryUnit travel separately.

A salary ranking that mixes hourly and annual amounts has no consistent pay interpretation.

The sort works. That's the annoying part.

The small fix is to partition by currency and unit before ranking. The more interesting work is deciding which postings remain eligible when a salary bound is missing, and naming the resulting statistic honestly.

What does a row actually count?

Dataspryva's vacancy Actor returns a record per matching federal vacancy in search mode. Your denominator is returned postings, not employees, hires or individual salary offers.

That distinction matters before any arithmetic.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.