As per my understanding, the string part before : is the starting string and the value after it is the variation.
Step 1 : Extract the prefix value for all the rows by splitting on :
df['base_term']=df.opening_name.apply(lambda x: x.split(":")[0])
This shall return a new column with values or the start string.
Step 2 : Retrieve the rows that have a given starting string , for example "Sicilian defence".
res = df.loc[df.base_term=='Sicilian defence']
res is the dataframe with rows that have opening_name beginning with 'Sicilian defence'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…