我想用python
和pandas
来做这个
假设我有以下几点:
file_id text
1 I am the first document. I am a nice document.
2 I am the second document. I am an even nicer document.
最后,我想要的是:
file_id text
1 I am the first document
1 I am a nice document
2 I am the second document
2 I am an even nicer document
所以我希望每个文件的文本在每个句点被拆分,并为这些文本的每个标记创建新行
最有效的方法是什么
用途:
解释:
首先对extract列使用^{} ,通过^{} 删除最后一个} 和escape } 重塑,对于Series,通过^{} 和} 的Series,通过^{} 和
.
,并通过^{.
进行拆分,因为特殊的正则表达式字符,对于Series,通过^{rename
重塑,对于^{rename
重塑为原始相关问题 更多 >
编程相关推荐