Here I have a dataframe like this(simplified example, the real df should be extended to over 3000 rows, and the number of groups in Y column might be larger than 20). What I