[Solved] how to know if a value is in the same range of time in python [closed]
You could group by name, next count values and filter results which have count 3 (because you have 3 years) groups = df.groupby(‘name’).count() result = groups[ groups[‘date’] == 3 ].index.to_list() print(result) Or you could directly count names counts = df[‘name’].value_counts() result = counts[ counts == 3 ].index.to_list() print(‘result:’, result) Minimal working example: I use io.StringIO … Read more