<pre><code>#sample dataframe used by me for testing:
df=pd.DataFrame({'col': {0: '3sprouts Cesto de Roupa Cisne Sprouts, 3Sprouts, Organizador',
1: 'Bright-Starts Mordedor Chocalho Rattle & Teethe, bright Starts, Rosa/Roxo',
2: 'Bright-Starts Mordedor Twist & Teethe, Starts, Multicor'}})
</code></pre>
<p>尝试:</p>
<pre><code>out=df['col'].str.title().str.split(', ',expand=True)
#For checking purpose
real=df['col'].str.split(', ',expand=True)
#for assigning purpose
real[1]=real[1].mask(out[0].str.contains(f'({"|".join(out[1])})'))
#checking if value in col 0 of out is present in the col 1 of out and passing that mask to real
real[2]=real[2].mask(out[0].str.contains(f'({"|".join(out[2])})'))
#checking if value in col 0 of out is present in the col 2 of out and passing that mask to real
df['col']=real.apply(lambda x:', '.join(x.dropna()),1)
#finally joining values by ', '
</code></pre>
<p><code>df</code>的输出:</p>
<pre><code> col
0 3sprouts Cesto de Roupa Cisne Sprouts, Organizador
1 Bright-Starts Mordedor Chocalho Rattle & Teethe, Rosa/Roxo
2 Bright-Starts Mordedor Twist & Teethe, Multicor
</code></pre>