如何在Python中连接Pandas系列的行

如何在Python中连接Pandas系列的行,python,pandas,Python,Pandas,我有一个Python熊猫系列,包含许多行,这些行包含一个单词列表,例如: 25 [estimated, million, people, lived, vulnerable... 176 [cent, vulnerable] 7 [create, sound, policy, frameworks, poor, vuln... 299 [create, sound, policy, frameworks,

我有一个Python熊猫系列,包含许多行,这些行包含一个单词列表,例如:

25     [estimated, million, people, lived, vulnerable...
176                                   [cent, vulnerable]
7      [create, sound, policy, frameworks, poor, vuln...
299    [create, sound, policy, frameworks, cent, vuln...
283    [missing, international, levels, based, estima...
                             ...                        
63     [create, sound, policy, frameworks, world, pop...
259             [build, world, population, still, lived]
193    [create, sound, policy, frameworks, every, sta...
284    [cent, situation, remains, particularly, alarm...
43     [based, less, cent, share, property, inheritan...
Name: clean_text, Length: 300, dtype: object
如何将所有行的单词连接到一个列表中?我试过:

nameofmyfile.str.cat(sep=', ')
但我有一个错误:

TypeError:无法将.str.cat与推断的数据类型“mixed”的值一起使用

这是一条很难的路

# step 1: Convert to a list
our_list = df["series"].tolist()

# step 2: Make a new empty list and build it up
new_list = []
for words in our_list:
    new_list += words

@Alexis给出的解决方案很好,但我始终反对使用循环并投票支持向量化。我创建了非常类似的系列,就像上面提到的一样,即:

>>a
福[嗨,你好,嗨]
酒吧[我,我,我自己]
数据类型:对象
现在使用numpy中的concatenate方法,将
foo,bar
的列表连接在一起,形成单个元素数组:

>>将numpy作为np导入
>>>np.连接(a.值)
数组(['hi','hello','hey','I','me','imf',dtype='1]