Created
May 26, 2016 00:07
-
-
Save mdengler/06505092587950f6ae2d5ba16da456f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
every_nth = [2, 3] | |
index = pd.Series(range(len(df.index))) # or just df.index if it's already the 0-indexed indices | |
mask = reduce(np.logical_or, [index % i == 0 for i in every_nth]) | |
df[mask.astype(bool).values] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment