Skip to content

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