How can I convert the following code into simple one line dynamically in Pandas? It is like always I have range of three numbers, and finding if the data exists in between that or not?
dataA = data.groupby('ID').apply(lambda x: (len(x) > 3) & (len(x) < 6))
dataB = data.groupby('ID').apply(lambda x: (len(x) > 6) & (len(x) < 9))
dataC = data.groupby('ID').apply(lambda x: (len(x) > 9) & (len(x) < 12))