我有一个csv文件
1 , name , 1012B-Amazon , 2044C-Flipcart , Bosh27-Walmart
2 , name , Kelvi20-Flipcart, LG-Walmart
3, name , Kenstar-Walmart, Sony-Amazon , Kenstar-Flipcart
4, name , LG18-Walmart, Bravia-Amazon
我需要由网站重新排列的行,即-
后的部分
可以用熊猫吗?找到一个sting的存在,并重新排列它,遍历所有行,然后对下一个字符串重复此操作?我浏览了Series.str.contains
和str.extract
的文档,但没有找到解决方案。在
将
sorted
与key
一起使用既然你提到了
^{pr2}$reindex
,我想get_dummies
会起作用的假设空值是
^{pr2}$np.nan
:更新
给出问题的更新,示例数据如下
一个可能的解决方案是
导致
问题更新后编辑:
这是abc csv:
这是公司csv(需要仔细观察逗号):
^{pr2}$这是密码
这是排序后的第一个结果_abc.csv公司公司名称:
将代码修改为查询的后续表单后, 这是分类的_公司.csv这是因为运行 脚本。在
我希望这有帮助!在
相关问题 更多 >
编程相关推荐