select records of dataframe `df` where the sum of column 'X' for each value in column 'User' is 0,df.groupby('User')['X'].filter(lambda x: x.sum() == 0)