1

I'm trying to calculate CLV(Customer Life Value) using lifetimes python library

so, I am fitting purchase behavior data on ParetoNBDFitter and fitting purchase price data on GammaGammaFitter.

and When I'm trying to calculate CLV based on GammaGammaFitter.customer_lifetime_value(), there are same errors about

NotImplementedError: Cannot apply ufunc <ufunc 'hyp2f1'> to mixed DataFrame and Series inputs.

Interestingly, I could calculate the CLV yesterday successfully, but today the above error is coming out. The code and data have not been modified.

My code looped by date, each time I redefined the model and then calculated the CLV.

enter image description here

m4n0
  • 29,823
  • 27
  • 76
  • 89
오진석
  • 21
  • 2

1 Answers1

-1

Workaround: use numpy instead of series. That is, do not use:

f.frequency

but

f.frequency.values
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77