1

I'm stuck! The goal is to count the number of customer transactions after initially being drawn in by a discount to determine "X% of customers never return when the first visit is discounted"

This was the best I could do:

postpurchase = (df_coup['DISC_BI'] == 1 & df_coup['LOGDATE'] > df_coup['LOGDATE1'])

I gotta think there's a way to loop this or something.

Data Frame:

data frame

1 Answers1

0

Try using sum:

postpurchase = ((df_coup['DISC_BI'] == 1) & (df_coup['LOGDATE'] > df_coup['LOGDATE1'])).sum()
U13-Forward
  • 69,221
  • 14
  • 89
  • 114
  • Shoot! Got this error. "TypeError: unsupported operand type(s) for &: 'int' and 'DatetimeArray'" I wouldn't think I need to convert the binomial to a string like a logit function...odd – Chris Moriarity Aug 20 '21 at 11:25