我想从转发中提取userhandles,即 “RT@用户名:xyzxyzxyz“到新列。我做了以下事情
df = pd.read_csv("string.csv")
for index,row in df.iterrows():
df['Influencers'] = df['Tweet'].str.extract("\(@*?)\:")
df.to_csv('string3.csv', index=False)
它产生了以下错误:
^{pr2}$样品DF:
df=pd.DataFrame({"Tweet": ["RT @saikatd: Are editors involved in the transfer of Income Tax officials?","RT @CLManojET: Can't allow L-G's fantasy of running a parallel administration"," Fairplay n equity 2 consumers 2 be ensured"]})
对不起,我解决了这个问题,但对于上述情况我无法实现其他条件:
它为else条件生成空白行。在
试试这个:
更新:
^{pr2}$相关问题 更多 >
编程相关推荐