How to group by one column and count frequency from other column for each item in the previous column in python?
This simple Code worked:

Count_sequence = df.groupby(['ID','Sequence']).count()


For obtaining the output in an excel sheet:

Count_sequence.to_excel('sequence_count.xlsx)