Skip to content

Instantly share code, notes, and snippets.

@zaoldyeck
Created July 23, 2019 08:40
Show Gist options
  • Save zaoldyeck/eedc8fb0977e00fd622e4e21b010b269 to your computer and use it in GitHub Desktop.
Save zaoldyeck/eedc8fb0977e00fd622e4e21b010b269 to your computer and use it in GitHub Desktop.
def 獲利年數(data):
eps = data.get('稀釋每股盈餘合計', 4*10).fillna(0)
count = 0
for start, end in zip(range(0, 37, 4), range(4, 41, 4)):
if not (eps.iloc[start:end].empty):
count += eps.iloc[start:end].sum() > 0
return count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment