【发布时间】:2018-03-30 18:44:21
【问题描述】:
如何使用 Pandas 和 Python 做到这一点?我正在使用 Jupyter Notebook。
我有一个这样的数据框:
col
0 2017 / something
1 $5.91 (× 1)
2 Premium
3 2017 / anotherthing
4 $16.0 (× 1)
5 Business
我想将那里的值拆分为自己的列,如下所示:
col revenue plan
0 2017 / something $5.91 (× 1) Premium
1 2017 / anotherthing $16.0 (× 1) Business
然后从收入列中删除括号值和美元符号,因此我最终得到以下结果:
col revenue plan
0 2017 / something 5.91 Premium
1 2017 / anotherthing 16.0 Business
【问题讨论】: