Skip to content

[ENH] Add flag_in_range function (resolves #708) - #1620

Open
naseem173 wants to merge 1 commit into
pyjanitor-devs:devfrom
naseem173:add-flag-in-range
Open

[ENH] Add flag_in_range function (resolves #708)#1620
naseem173 wants to merge 1 commit into
pyjanitor-devs:devfrom
naseem173:add-flag-in-range

Conversation

@naseem173

Copy link
Copy Markdown

Resolves #708
Adds a new flag_in_range function following the same pattern as the existing flag_nulls function. It appends a flag column indicating whether each row's value in a given column falls outside a specified [low, high] range, supports inclusive/exclusive bounds via the inclusive parameter, supports custom output column naming via flag_column_name, and does not mutate the original DataFrame.

Includes tests in tests/functions/test_flag_in_range.py mirroring the existing test_flag_nulls.py test structure, and a CHANGELOG entry.

Note: flag semantics (1 = out of range) were chosen to match flag_nulls's convention. Left a comment on the issue to confirm this interpretation with the maintainer before finalizing.

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.90%. Comparing base (901f4b3) to head (1f00a61).
⚠️ Report is 192 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1620      +/-   ##
==========================================
- Coverage   87.56%   85.90%   -1.67%     
==========================================
  Files          95      126      +31     
  Lines        6819     9930    +3111     
==========================================
+ Hits         5971     8530    +2559     
- Misses        848     1400     +552     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the ability to test whether data is in range in a pandas data frame

1 participant