This PR will introduce the following:
- 🍉 major changes:
- <insert_major_change_1>
- <insert_major_change_2>
Character | Description | Example |
---|---|---|
* |
Matches any character 0+ times | foo* matches any string beginning with foo |
? |
Matches a character | foo? matches any 4-character string beginning with foo |
[] |
Matches any character inside the brackets | *.[ch] matches any string ending with .c or .h |
Class | Inclusion |
---|---|
[:alnum:] (same as A-z0-9 ) |
Lowercase or uppercase alphabets or digits |
matcher.pairs[(matcher.pairs['name1']==name)|(matcher.pairs['name2']==name)] |
class Matcher(): | |
def __init__(self, emp_df, hist_df, group_size): | |
self.emp_df = emp_df | |
self.hist_df = hist_df | |
self.group_size = group_size | |
def find_constraints(self, n=10): | |
if self.hist_df['date'].nunique()<=n: | |
recent_hist_df = self.hist_df | |
else: |
matcher = Matcher(employee_df, history_df) | |
n_weeks = 26 | |
for i in range(n_weeks): | |
matcher.get_matches(start_dt+(i+1)*delta) | |
matcher.hist_df |
matcher.hist_df[(matcher.hist_df['name1']==name)|(matcher.hist_df['name2']==name)] |
matcher.constraints[name] |
n_weeks = 5 | |
delta = pd.Timedelta(7, unit='d') | |
for i in range(n_weeks): | |
matcher.get_matches(start_dt+(i+1)*delta) | |
matcher.hist_df |
employee_df[(employee_df['name']==name)|(employee_df['manager']==name)] |
name = 'Noah Rhodes' | |
matcher.constraints[name] |