Skip to content

Instantly share code, notes, and snippets.

@djmunro
Last active December 12, 2016 20:59
Show Gist options
  • Save djmunro/1539d6ea19765db0372fa3181bdde9ef to your computer and use it in GitHub Desktop.
Save djmunro/1539d6ea19765db0372fa3181bdde9ef to your computer and use it in GitHub Desktop.
[-64, 0, 63.5, None]
[0, 50, 100, None]
[3, 15, 28.5, None]
[0, 1, 2, 3]
#I have 4 lists like what's seen above. I want a generator, when I call it will return the count of items at 1st, then 2nd,... index
#so from the above example, I want the following outpout
#>> next(), 4
#>> next(), 4
#>> next(), 4
#>> next(), 1
#so in the case the index of any one of the 4 arrays isn't None, add it to the count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment