-
Notifications
You must be signed in to change notification settings - Fork 201
New Jersey TANF earned income disregard #2222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
xudonglai0426
wants to merge
8
commits into
PolicyEngine:main
from
xudonglai0426:xudonglai0426/issue2217
Closed
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
268a820
New Jersey TANF earned income disregard
xudonglai0426 0e6afc3
New Jersey TANF earned income disregard #2217
xudonglai0426 34c35f2
New Jersey TANF earned income disregard
xudonglai0426 7f34cf1
New Jersey TANF earned income disregard
xudonglai0426 9588608
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
xudonglai0426 51c5362
New Jersey TANF earned income disregard
xudonglai0426 8999751
New Jersey TANF earned income disregard
xudonglai0426 16a9ae0
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
xudonglai0426 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| - bump: minor | ||
| changes: | ||
| added: | ||
| - New Jeresy TANF earned income disregards. |
11 changes: 11 additions & 0 deletions
11
.../gov/states/nj/njdhs/tanf/income/earned_income_deduction/consecutive_month_threshold.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| description: New Jersey fully excludes 50% earned income for person who enrolled TANF program over this amount of time. | ||
|
|
||
| metadata: | ||
| unit: month | ||
| label: New Jersey TANF earned income deduction | ||
| reference: | ||
| - title: New Jersey Administrative Code(N.J.A.C 10:90-3.8) | ||
| href: https://advance.lexis.com/documentpage/teaserdocument/?pdmfid=1000516&crid=1e9b7e3d-233e-4b7c-898f-b53548066f3f&config=00JAA1YTg5OGJlYi04MTI4LTRlNjQtYTc4Yi03NTQxN2E5NmE0ZjQKAFBvZENhdGFsb2ftaXPxZTR7bRPtX1Jok9kz&pddocfullpath=%2Fshared%2Fdocument%2Fadministrative-codes%2Furn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pddocid=urn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pdcontentcomponentid=234122&pdteaserkey=h1&pditab=allpods&ecomp=8s65kkk&earg=sr0&prid=187e8c01-622c-460c-be94-0bb33d5ca4d2 | ||
|
|
||
| values: | ||
| 2022-10-01: 7.0 |
11 changes: 11 additions & 0 deletions
11
...meters/gov/states/nj/njdhs/tanf/income/earned_income_deduction/first_month_threshold.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| description: New Jersey fully excludes 100% of earned income for person who have enrolled in TANF program below this amount of time. | ||
|
|
||
| metadata: | ||
| unit: month | ||
| label: New Jersey TANF earned income deduction first month threshold | ||
| reference: | ||
| - title: New Jersey Administrative Code(N.J.A.C 10:90-3.8) | ||
| href: https://advance.lexis.com/documentpage/teaserdocument/?pdmfid=1000516&crid=1e9b7e3d-233e-4b7c-898f-b53548066f3f&config=00JAA1YTg5OGJlYi04MTI4LTRlNjQtYTc4Yi03NTQxN2E5NmE0ZjQKAFBvZENhdGFsb2ftaXPxZTR7bRPtX1Jok9kz&pddocfullpath=%2Fshared%2Fdocument%2Fadministrative-codes%2Furn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pddocid=urn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pdcontentcomponentid=234122&pdteaserkey=h1&pditab=allpods&ecomp=8s65kkk&earg=sr0&prid=187e8c01-622c-460c-be94-0bb33d5ca4d2 | ||
|
|
||
| values: | ||
| 2022-10-01: 1.0 |
11 changes: 11 additions & 0 deletions
11
...es/nj/njdhs/tanf/income/earned_income_deduction/higher_work_hours/additional_percent.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| description: New Jersey excludes this percentage of earned income for household enrolled in TANF for each additional month. | ||
|
|
||
| metadata: | ||
| unit: /1 | ||
| label: New Jersey TANF earned income deduction | ||
| reference: | ||
| - title: New Jersey Administrative Code(N.J.A.C 10:90-3.8) | ||
| href: https://advance.lexis.com/documentpage/teaserdocument/?pdmfid=1000516&crid=1e9b7e3d-233e-4b7c-898f-b53548066f3f&config=00JAA1YTg5OGJlYi04MTI4LTRlNjQtYTc4Yi03NTQxN2E5NmE0ZjQKAFBvZENhdGFsb2ftaXPxZTR7bRPtX1Jok9kz&pddocfullpath=%2Fshared%2Fdocument%2Fadministrative-codes%2Furn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pddocid=urn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pdcontentcomponentid=234122&pdteaserkey=h1&pditab=allpods&ecomp=8s65kkk&earg=sr0&prid=187e8c01-622c-460c-be94-0bb33d5ca4d2 | ||
|
|
||
| values: | ||
| 2022-10-01: 0.5 |
11 changes: 11 additions & 0 deletions
11
...jdhs/tanf/income/earned_income_deduction/higher_work_hours/consecutive_month_percent.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| description: New Jersey excludes this percentage of earned income for 6 consecutive months for person who enrolles in TANF Program and continues work for more than 20h/week after the first month. | ||
|
|
||
| metadata: | ||
| unit: /1 | ||
| label: New Jersey TANF earned income deduction | ||
| reference: | ||
| - title: New Jersey Administrative Code(N.J.A.C 10:90-3.8) | ||
| href: https://advance.lexis.com/documentpage/teaserdocument/?pdmfid=1000516&crid=1e9b7e3d-233e-4b7c-898f-b53548066f3f&config=00JAA1YTg5OGJlYi04MTI4LTRlNjQtYTc4Yi03NTQxN2E5NmE0ZjQKAFBvZENhdGFsb2ftaXPxZTR7bRPtX1Jok9kz&pddocfullpath=%2Fshared%2Fdocument%2Fadministrative-codes%2Furn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pddocid=urn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pdcontentcomponentid=234122&pdteaserkey=h1&pditab=allpods&ecomp=8s65kkk&earg=sr0&prid=187e8c01-622c-460c-be94-0bb33d5ca4d2 | ||
|
|
||
| values: | ||
| 2022-10-01: 0.75 |
11 changes: 11 additions & 0 deletions
11
...s/nj/njdhs/tanf/income/earned_income_deduction/higher_work_hours/first_month_percent.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| description: New Jersey fully excludes this percentage of earned income for person who enrolled in the first month of TANF program. | ||
|
|
||
| metadata: | ||
| unit: /1 | ||
| label: New Jersey TANF earned income deduction | ||
| reference: | ||
| - title: New Jersey Administrative Code(N.J.A.C 10:90-3.8) | ||
| href: https://advance.lexis.com/documentpage/teaserdocument/?pdmfid=1000516&crid=1e9b7e3d-233e-4b7c-898f-b53548066f3f&config=00JAA1YTg5OGJlYi04MTI4LTRlNjQtYTc4Yi03NTQxN2E5NmE0ZjQKAFBvZENhdGFsb2ftaXPxZTR7bRPtX1Jok9kz&pddocfullpath=%2Fshared%2Fdocument%2Fadministrative-codes%2Furn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pddocid=urn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pdcontentcomponentid=234122&pdteaserkey=h1&pditab=allpods&ecomp=8s65kkk&earg=sr0&prid=187e8c01-622c-460c-be94-0bb33d5ca4d2 | ||
|
|
||
| values: | ||
| 2022-10-01: 1.0 |
11 changes: 11 additions & 0 deletions
11
...tes/nj/njdhs/tanf/income/earned_income_deduction/lower_work_hours/additional_percent.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| description: New Jersey excludes this percentage of earned income for household enrolled in TANF for each additional month. | ||
|
|
||
| metadata: | ||
| unit: /1 | ||
| label: New Jersey TANF earned income deduction | ||
| reference: | ||
| - title: New Jersey Administrative Code(N.J.A.C 10:90-3.8) | ||
| href: https://advance.lexis.com/documentpage/teaserdocument/?pdmfid=1000516&crid=1e9b7e3d-233e-4b7c-898f-b53548066f3f&config=00JAA1YTg5OGJlYi04MTI4LTRlNjQtYTc4Yi03NTQxN2E5NmE0ZjQKAFBvZENhdGFsb2ftaXPxZTR7bRPtX1Jok9kz&pddocfullpath=%2Fshared%2Fdocument%2Fadministrative-codes%2Furn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pddocid=urn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pdcontentcomponentid=234122&pdteaserkey=h1&pditab=allpods&ecomp=8s65kkk&earg=sr0&prid=187e8c01-622c-460c-be94-0bb33d5ca4d2 | ||
|
|
||
| values: | ||
| 2022-10-01: 0.5 |
11 changes: 11 additions & 0 deletions
11
...es/nj/njdhs/tanf/income/earned_income_deduction/lower_work_hours/first_month_percent.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| description: New Jersey fully excludes this percentage of earned income for person who enrolled in the first month of TANF program. | ||
|
|
||
| metadata: | ||
| unit: /1 | ||
| label: New Jersey TANF earned income deduction | ||
| reference: | ||
| - title: New Jersey Administrative Code(N.J.A.C 10:90-3.8) | ||
| href: https://advance.lexis.com/documentpage/teaserdocument/?pdmfid=1000516&crid=1e9b7e3d-233e-4b7c-898f-b53548066f3f&config=00JAA1YTg5OGJlYi04MTI4LTRlNjQtYTc4Yi03NTQxN2E5NmE0ZjQKAFBvZENhdGFsb2ftaXPxZTR7bRPtX1Jok9kz&pddocfullpath=%2Fshared%2Fdocument%2Fadministrative-codes%2Furn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pddocid=urn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pdcontentcomponentid=234122&pdteaserkey=h1&pditab=allpods&ecomp=8s65kkk&earg=sr0&prid=187e8c01-622c-460c-be94-0bb33d5ca4d2 | ||
|
|
||
| values: | ||
| 2022-10-01: 1.0 |
11 changes: 11 additions & 0 deletions
11
...ameters/gov/states/nj/njdhs/tanf/income/earned_income_deduction/work_hours_threshold.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| description: New York excludes this percentage of earned income for the purposes of its TANF program. | ||
|
|
||
| metadata: | ||
| unit: hours | ||
| label: New Jeresy TANF | ||
| reference: | ||
| - title: New Jersey Administrative Code(N.J.A.C 10:90-3.8) | ||
| href: https://advance.lexis.com/documentpage/teaserdocument/?pdmfid=1000516&crid=1e9b7e3d-233e-4b7c-898f-b53548066f3f&config=00JAA1YTg5OGJlYi04MTI4LTRlNjQtYTc4Yi03NTQxN2E5NmE0ZjQKAFBvZENhdGFsb2ftaXPxZTR7bRPtX1Jok9kz&pddocfullpath=%2Fshared%2Fdocument%2Fadministrative-codes%2Furn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pddocid=urn%3AcontentItem%3A5XKV-PW31-F22N-X2CF-00008-00&pdcontentcomponentid=234122&pdteaserkey=h1&pditab=allpods&ecomp=8s65kkk&earg=sr0&prid=187e8c01-622c-460c-be94-0bb33d5ca4d2 | ||
|
|
||
| values: | ||
| 2022-10-01: 20 |
59 changes: 59 additions & 0 deletions
59
...ne_us/tests/policy/baseline/gov/states/nj/njdhs/tanf/nj_tanf_countable_earned_income.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| - name: NJ countable earned income = gross earned income*(1-100%) for first month. | ||
| period: 2023 | ||
| input: | ||
| state_code: NJ | ||
| nj_tanf_gross_earned_income: 6_000 | ||
| months_enrolled_in_tanf: 1 | ||
| hours_worked: 2_080 | ||
| output: | ||
| nj_tanf_countable_earned_income: 0 | ||
|
|
||
| - name: NJ countable earned income = gross earned income*(1-75%) for applicant with weekly working hours over 20 in 2nd month. | ||
| period: 2023 | ||
| input: | ||
| state_code: NJ | ||
| nj_tanf_gross_earned_income: 6_000 | ||
| months_enrolled_in_tanf: 2 | ||
| hours_worked: 2_080 | ||
| output: | ||
| nj_tanf_countable_earned_income: 1_500 | ||
|
|
||
| - name: NJ countable earned income = gross earned income*(1-50%) for applicant with weekly working hours under 20 in 2nd month. | ||
| period: 2023 | ||
| input: | ||
| state_code: NJ | ||
| nj_tanf_gross_earned_income: 6_000 | ||
| months_enrolled_in_tanf: 2 | ||
| hours_worked: 988 | ||
| output: | ||
| nj_tanf_countable_earned_income: 3_000 | ||
|
|
||
| - name: NJ countable earned income = gross earned income*(1-75%) for applicant with weekly working hours over 20 in 7nd month. | ||
| period: 2023 | ||
| input: | ||
| state_code: NJ | ||
| nj_tanf_gross_earned_income: 6_000 | ||
| months_enrolled_in_tanf: 7 | ||
| hours_worked: 2_080 | ||
| output: | ||
| nj_tanf_countable_earned_income: 1_500 | ||
|
|
||
| - name: NJ countable earned income = gross earned income*(1-50%) for applicant with weekly working hours over 20 in 8nd month. | ||
| period: 2023 | ||
| input: | ||
| state_code: NJ | ||
| nj_tanf_gross_earned_income: 6_000 | ||
| months_enrolled_in_tanf: 8 | ||
| hours_worked: 2_080 | ||
| output: | ||
| nj_tanf_countable_earned_income: 3_000 | ||
|
|
||
| - name: NJ countable earned income = gross earned income*(1-75%) for applicant with weekly working hours over 20 in 2nd month. | ||
| period: 2023 | ||
| input: | ||
| state_code: NJ | ||
| nj_tanf_gross_earned_income: 6_000 | ||
| months_enrolled_in_tanf: 2 | ||
| hours_worked: 1_040 | ||
| output: | ||
| nj_tanf_countable_earned_income: 1_500 |
59 changes: 59 additions & 0 deletions
59
policyengine_us/variables/gov/states/nj/njdhs/tanf/income/nj_tanf_countable_earned_income.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| from policyengine_us.model_api import * | ||
|
|
||
|
|
||
| class nj_tanf_countable_earned_income(Variable): | ||
| value_type = float | ||
| entity = SPMUnit | ||
| label = "New Jersey TANF countable earned income" | ||
| unit = USD | ||
| definition_period = YEAR | ||
| defined_for = StateCode.NJ | ||
|
|
||
| def formula(spm_unit, period, parameters): | ||
| person = spm_unit.members | ||
| # Get gross earned income. | ||
| gross_earned_income = spm_unit("nj_tanf_gross_earned_income", period) | ||
| p = parameters( | ||
| period | ||
| ).gov.states.nj.njdhs.tanf.income.earned_income_deduction | ||
| months_enrolled_in_tanf = person("months_enrolled_in_tanf", period) | ||
| weekly_hours_worked = person("weekly_hours_worked", period) | ||
| # New Jerset Admin Code 10:90-3.8(b) | ||
| person_meet_higher_work_hours_threshold = ( | ||
| weekly_hours_worked >= p.work_hours_threshold | ||
| ) | ||
| person_enrolled_in_tanf_for_first_month = ( | ||
| months_enrolled_in_tanf <= p.first_month_threshold | ||
| ) | ||
| person_enrolled_in_tanf_for_consecutive_months = ( | ||
| months_enrolled_in_tanf <= p.consecutive_month_threshold | ||
| ) and (months_enrolled_in_tanf > p.first_month_threshold) | ||
| person_enrolled_in_tanf_for_additional_months_with_work_hours_over_20 = ( | ||
| months_enrolled_in_tanf > p.consecutive_month_threshold | ||
| and person_meet_higher_work_hours_threshold | ||
| ) | ||
| person_enrolled_in_tanf_for_additional_months_with_Work_hours_below_20 = ( | ||
| months_enrolled_in_tanf > p.first_month_threshold | ||
| ) | ||
| if person_meet_higher_work_hours_threshold: | ||
| if person_enrolled_in_tanf_for_first_month: | ||
| return gross_earned_income * ( | ||
| 1 - p.higher_work_hours.first_month_percent | ||
| ) | ||
| elif person_enrolled_in_tanf_for_consecutive_months: | ||
| return gross_earned_income * ( | ||
| 1 - p.higher_work_hours.consecutive_month_percent | ||
| ) | ||
| elif person_enrolled_in_tanf_for_additional_months_with_work_hours_over_20: | ||
| return gross_earned_income * ( | ||
| 1 - p.higher_work_hours.additional_percent | ||
| ) | ||
| else: | ||
| if person_enrolled_in_tanf_for_first_month: | ||
| return gross_earned_income * ( | ||
| 1 - p.lower_work_hours.first_month_percent | ||
| ) | ||
| elif person_enrolled_in_tanf_for_additional_months_with_Work_hours_below_20: | ||
| return gross_earned_income * ( | ||
| 1 - p.lower_work_hours.additional_percent | ||
| ) | ||
9 changes: 9 additions & 0 deletions
9
policyengine_us/variables/household/income/person/tanf_enrolled/months_enrolled_in_tanf.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from policyengine_us.model_api import * | ||
|
|
||
|
|
||
| class months_enrolled_in_tanf(Variable): | ||
| value_type = float | ||
| entity = Person | ||
| label = "Months enrolled in TANF" | ||
| definition_period = YEAR | ||
| unit = "month" |
9 changes: 9 additions & 0 deletions
9
policyengine_us/variables/household/income/person/work/hours_worked.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from policyengine_us.model_api import * | ||
|
|
||
|
|
||
| class hours_worked(Variable): | ||
| value_type = float | ||
| entity = Person | ||
| label = "Total amount of hours worked by this person" | ||
| definition_period = YEAR | ||
| unit = "hour" |
14 changes: 14 additions & 0 deletions
14
policyengine_us/variables/household/income/person/work/weekly_hours_worked.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from policyengine_us.model_api import * | ||
|
|
||
|
|
||
| class weekly_hours_worked(Variable): | ||
| value_type = float | ||
| entity = Person | ||
| label = "Weekly hours" | ||
| documentation = "Average weekly hours worked" | ||
| definition_period = YEAR | ||
| unit = "hour" | ||
| quantity_type = FLOW | ||
|
|
||
| def formula(person, period, parameters): | ||
| return person("hours_worked", period) / WEEKS_IN_YEAR |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
ifstatements aren't vectorized, we have to usewhereandselectstatements insteadThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Is there an example shows how to use "select" statement or how to use "where" and "select" to achieve the function of "if" there? Originally, we are using a nested where function, it is not so readable although it passes all the test. That's why we are trying to use "if" function.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xudonglai0426 see my comment in the review below. Select is much cleaner than nested where (although both are vectorized).
ifwill still achieve the same result, but is not vectorized so it will be much slower.