【发布时间】:2020-12-15 08:59:04
【问题描述】:
我想在这里寻求您的帮助。我有一个带有“标签”列的数据框,该列有多个用逗号分隔的子字符串。我想将子字符串拆分为逗号并根据子字符串复制行。下面是一个示例操作。
样本df
A B C D E Tag
A mug computer stack code phone labor relation, m&a, h&s
google virjoy plant ivan wrong business, environment
gazette nowhere conquer jermo chris business ethics
spray hilda square walk nonsense m&a, hiring and expansion
Florence plug nihilist font hello h&s, wages and hours, product recall
输出df
A B C D E Tag New Tag
A mug computer stack code phone labor relation, m&a, h&s labor relation
A mug computer stack code phone labor relation, m&a, h&s m&a
A mug computer stack code phone labor relation, m&a, h&s h&s
google virjoy plant ivan wrong business, environment business
google virjoy plant ivan wrong business, environment environment
gazette nowhere conquer jermo chris business ethics business ethics
spray hilda square walk nonsense m&a, hiring and expansion m&a
spray hilda square walk nonsense m&a, hiring and expansion hiring and expansion
Florence plug nihilist font hello h&s, wages and hours, product recall h&s
Florence plug nihilist font hello h&s, wages and hours, product recall wages and hours
Florence plug nihilist font hello h&s, wages and hours, product recall product recall
我正在考虑通过','进行拆分操作,然后可能会像融化? 将不胜感激任何帮助!非常感谢提前!
【问题讨论】: