Skip to content

Commit

Permalink
Fix match percent variable
Browse files Browse the repository at this point in the history
  • Loading branch information
b-j-mills committed Nov 25, 2024
1 parent e731d5b commit 3eaf630
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions check_pcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def parse_tabular(df: DataFrame, file_ext: str) -> DataFrame:
return df


def check_pcoded(df: DataFrame, pcodes: List[str], pcnt_match: float) -> bool:
def check_pcoded(df: DataFrame, pcodes: List[str], match_cutoff: float) -> bool:
pcoded = None
header_exp = "((adm)?.*p?.?cod.*)|(#\s?adm\s?\d?\+?\s?p?(code)?)"

Expand All @@ -200,7 +200,7 @@ def check_pcoded(df: DataFrame, pcodes: List[str], pcnt_match: float) -> bool:
continue
matches = sum(column.isin(pcodes))
pcnt_match = matches / len(column)
if pcnt_match >= pcnt_match:
if pcnt_match >= match_cutoff:
pcoded = True

return pcoded
Expand Down

0 comments on commit 3eaf630

Please # to comment.