【发布时间】:2023-01-26 04:55:20
【问题描述】:
我有一个包含地址的数据框。
| Addressess |
|---|
| 10 Pentland Drive, Comiston, Edinburgh, EH10 6PX. |
| Moray Place, Edinburgh, EH3 |
| Carlton Street, Edinburgh |
| The Bourse Apartments, 47 Timber Bush, Leith EH6 6QH |
我希望用 python 和 pandas 编写代码来识别行中是否有“EH”,然后将此字符和所有后续字符移动到另一列中。从而实现这一点:
| Addressess | Post Code |
|---|---|
| 10 Pentland Drive, Comiston, Edinburgh, . | EH10 6PX |
| Moray Place, Edinburgh, | EH3 |
| Carlton Street, Edinburgh | |
| The Bourse Apartments, 47 Timber Bush, Leith EH6 6QH | EH6 6QH |
谁能帮忙?
【问题讨论】:
标签: pandas