df['mutation_type'] = df['MUT'].apply(lambda x: re.sub(
    '^.*?:([^:]+:[^:]+)$', '\\1', x))
df.groupby(['SAMPLE', 'mutation_type']).agg('count')['MUT']
Count rows that match string and numeric with pandas