我有以下数据帧:
import pandas as pd
df = pd.DataFrame({'Probes':["1415693_at","1415693_at"],
'Genes':["Canx","LOC101056688 /// Wars "],
'cv_filter':[ 0.134,0.290],
'Organ' :["LN","LV"]} )
df = df[["Probes","Genes","cv_filter","Organ"]]
看起来像这样:
^{pr2}$我要做的是根据输入的Genes列拆分行 以“///”分隔。在
我想得到的结果是
Probes Genes cv_filter Organ
0 1415693_at Canx 0.134 LN
1 1415693_at LOC101056688 0.290 LV
2 1415693_at Wars 0.290 LV
我总共有大约15万行要检查。有没有一种快速处理的方法?在
您可以先尝试^{} 列} 将其还原为原始
Genes
,创建新的Series
,然后^{df
:相关问题 更多 >
编程相关推荐