You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I'm a research assistant trying to use this code for our own project. However, our data is large, so I'm rewriting ui_calculator.py in a way that takes advantage of column/dataframe operations (as opposed to the current approach of calculating everything one row at a time via list comprehension).
Why is there a distinction made between earnings_history and base_period?
Per observation, earnings_history is a list [q1, q2, q3, q4, 0] . I interpret this as the earnings history (q1-q4) plus a 0 to represent the current quarter where the individual is unemployed. This is from the definition of calc_weekly_state_quarterly().
Then, in the definition of calc_weekly_state(), we create base_period = earnings_hist[-5:-1], which is the same as [q1, q2, q3, q4]. From here, we only use base_period. Why add the 0 just to ignore it completely?
Somewhat related, I notice we index [-5:-1] when [:4] is equivalent; is the intended result a reversing ordering like [q4, q3, q2, q1]?
The text was updated successfully, but these errors were encountered:
Hi! I'm a research assistant trying to use this code for our own project. However, our data is large, so I'm rewriting
ui_calculator.py
in a way that takes advantage of column/dataframe operations (as opposed to the current approach of calculating everything one row at a time via list comprehension).Why is there a distinction made between
earnings_history
andbase_period
?Per observation,
earnings_history
is a list[q1, q2, q3, q4, 0]
. I interpret this as the earnings history (q1
-q4
) plus a 0 to represent the current quarter where the individual is unemployed. This is from the definition ofcalc_weekly_state_quarterly()
.Then, in the definition of
calc_weekly_state()
, we createbase_period = earnings_hist[-5:-1]
, which is the same as[q1, q2, q3, q4]
. From here, we only usebase_period
. Why add the 0 just to ignore it completely?Somewhat related, I notice we index
[-5:-1]
when[:4]
is equivalent; is the intended result a reversing ordering like[q4, q3, q2, q1]
?The text was updated successfully, but these errors were encountered: