Skip to content

Commit

Permalink
Ensure company name is string in meal outlier classifier
Browse files Browse the repository at this point in the history
  • Loading branch information
cuducos committed Dec 29, 2019
1 parent 7c4194b commit a20cbc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def predict(self, X):
def __applicable_rows(self, X):
return (X['category'] == 'Meal') & \
(X['recipient_id'].str.len() == 14) & \
(~X['recipient'].apply(self.__normalize_string).str.contains(self.HOTEL_REGEX))
(~X['recipient'].fillna('').apply(self.__normalize_string).str.contains(self.HOTEL_REGEX))

def __applicable_company_rows(self, companies):
return (companies['congresspeople'] > 3) & (companies['records'] > 20)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ applicant_id,category,recipient_id,recipient,net_value
444,Meal,22472225000183,GOL,400
444,Flight ticket issue,22472225000183,GOL,9999999
444,Flight ticket issue,22472225000183,GOL,5
444,Meal,11111111111111,,42

0 comments on commit a20cbc4

Please sign in to comment.