Skip to content

Instantly share code, notes, and snippets.

@chris-lovejoy
Created November 21, 2020 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris-lovejoy/11dd6d50a23d463749585c733bc33eb8 to your computer and use it in GitHub Desktop.
Save chris-lovejoy/11dd6d50a23d463749585c733bc33eb8 to your computer and use it in GitHub Desktop.
Function to calculate view-to-sub ratio
# Function to calculate view-to-sub ratio
def view_to_sub_ratio(viewcount, num_subscribers):
if num_subscribers == 0:
return 0
else:
ratio = viewcount / num_subscribers
return ratio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment