Skip to content

Instantly share code, notes, and snippets.

@SouravJohar
Created November 27, 2021 22:08
Show Gist options
  • Save SouravJohar/9093e628099c522a39d419dcc78779e9 to your computer and use it in GitHub Desktop.
Save SouravJohar/9093e628099c522a39d419dcc78779e9 to your computer and use it in GitHub Desktop.
users = {}
for i in range(len(df)):
user_id = df.iloc[i].user_id
if user_id not in users:
users[user_id] = 1
else:
users[user_id] += 1
num_recipes_range = (100,500)
users_of_interest = []
for user, num_recipes in users.items():
if num_recipes >= 100 and num_recipes <= 500:
users_of_interest.append(user)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment