具体来说,我正在使用quoracsv文件,我将它加载到一个pandas数据帧中,结构如下所示。你知道吗
------------------------------------------------------------------------
id| qid1| qid2| question1text |question2text |is_duplicate
------------------------------------------------------------------------
01|00001|00002|Why do we exist?| Is there life on Mars? | 0
02|00001|00003|Why do we exist?| What happens after death?| 0
因此,我想将所有不同的问题及其问题id和相应的文本传递到一个新的数据框中,该数据框有两列,只有问题id和相应的问题文本,如下所示:
---------------------------
qid |questiontext |
---------------------------
00001|Why do we exist?
00002|Is there life on Mars?
00003|What happens after death?
调整
columns
后使用wide_to_long
那我们需要
drop_duplicates
相关问题 更多 >
编程相关推荐