擅长:python、mysql、java
<p>使用<code>.apply(" ".join)</code></p>
<p><strong>例如:</strong></p>
<pre><code>import pandas as pd
df = pd.DataFrame({'Test': [['fed', 'official', 'say', 'weak', 'data', 'caused', 'weather', 'slow', 'taper'],
['fed', "'s", 'charles', 'plosser', 'see', 'high', 'bar', 'change', 'pace', 'tapering']
]
})
print(df["Test"].apply(" ".join))
</code></pre>
<p><strong>输出:</strong></p>
<pre><code>0 fed official say weak data caused weather slow...
1 fed 's charles plosser see high bar change pac...
Name: Test, dtype: object
</code></pre>