Check both values by DataFrame.isin and then replace only rows with at least one True with DataFrame.where:
m = df.isin(['DI','DD'])
m1 = m.any(1)
df[m1] = df[m1].where(m, 'II')
Or use numpy broadcasting for chain both masks:
m = df.isin(['DI','DD'])
df = df.where(m.values | ~m.any(1).values[:, None], 'II')
print (df)
0 1 2 3 4 5
0 s1 AA AG AG GG AA
1 II DI DD II II II
2 S3 TT CC TC TT TC
3 II II DI II II II
4 II II II DD II II
EDIT:
Working with - is possible by chained mask by | for bitwise OR:
print (df)
0 1 2 3 4 5
0 s1 AA AG AG GG -
1 s2 DI DD GG GG -
2 S3 TT CC TC TT TC
3 S3 AA DI AA AA AA
4 S3 CC CC DD CC CC
m = df.isin(['DI','DD'])
m1 = m.any(1)
df[m1] = df[m1].where(m | df.eq('-'), 'II')
print (df)
0 1 2 3 4 5
0 s1 AA AG AG GG -
1 II DI DD II II -
2 S3 TT CC TC TT TC
3 II II DI II II II
4 II II II DD II II