私信  •  关注

keramat

keramat 最近创建的主题
keramat 最近回复了
3 年前
回复了 keramat 创建的主题 » 在Python中向新添加的列追加数据

使用:

temp = df.index
df.loc[temp[i], 'Summary'] = text
6 年前
回复了 keramat 创建的主题 » 用python从文本文件中提取数据

试试这个:

with open('text.txt') as file:
text = file.read()
text = text.replace('\n', ' ')
s = text.split('CATEG:')
s = [x.strip() for x in s if x != '']
print(s)