Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Calculate the correct EPS Growth Rate

Modifying the post a bit to make it clearer

I'm trying to determine the growth rate for two EPS values: the current quarter vs the same quarter a year ago. The challenge that I'm finding is that depending if the earnings are positive or negative, the sign on the growth rate is not correct. I would normally just use a conditional statement and apply a negative sign correctly, but this is all captured in factors and I haven't been able to figure out how to conditionally change the sign. I tried "np.where" but got errors.

I've attached a notebook to hopefully make it easier for someone to help.

Thanks!
--Brian

2 responses

bump, since I rewrote the description

I don't know about the code, but I can tell you a simple way to set up this calculation to get the correct EPS growth no matter the signs of the values compared.

[(New-Old)/(ABS(Old))]

For example:
New = .01 , Old = -.01 , result = (.01--.01)/.01) = 2%
New = -.01 , Old = .01 , results (-.01-.01)/.01) = -2%

Don't know if that helps but there you are!