Skip to content
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

Updating recency_end_date reference #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cbrow97
Copy link

@cbrow97 cbrow97 commented Dec 23, 2020

The recency_end_date variable is referencing the user passed variable value and not the class attribute that is transformed using the strptime() function:
self.data = convert_transaction_to_user(self.data, recency_end_date=recency_end_date)

The variable should be prefixed with the self. keyword:
self.data = convert_transaction_to_user(self.data, recency_end_date=self.recency_end_date)

This is causing an issue when the recency_end_date value is passed to the convert_transaction_to_user() function, specifically on this line of code:

df_recency = df.groupby([id_col])[date_col].max().apply(lambda date: (end_date - date).days).astype(float)
TypeError: unsupported operand type(s) for -: 'str' and 'Timestamp'

The recency_end_date variable is referencing the user passed variable value and not the class attribute that is transformed using the strptime() function:
self.data = convert_transaction_to_user(self.data, recency_end_date=recency_end_date)


The variable should be prefixed with the self. keyword:
self.data = convert_transaction_to_user(self.data, recency_end_date=self.recency_end_date)

This is causing an issue when the recency_end_date value is passed to the convert_transaction_to_user() function, specifically on this line of code:

df_recency = df.groupby([id_col])[date_col].max().apply(lambda date: (end_date - date).days).astype(float)
TypeError: unsupported operand type(s) for -: 'str' and 'Timestamp'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant