推 iphone2003: 試試''.join([s if s.isdigit() for s in string])?09/04 13:08
推 HenryLiKing: 用RE呢?09/04 13:14
→ HenryLiKing: 把不是0-9的都用 re.sub去掉09/04 13:15
推 renshin: 先用正規表示式抓出你要的,再轉成數值09/04 15:35
推 Angesi: 關鍵:正規表示式 結案09/04 18:02
→ tzjnrsnh: 感謝大家,已解決了09/04 22:20
※ 編輯: tzjnrsnh (117.19.233.238), 09/04/2018 22:21:03
推 woogee: df.交易金額[~df.交易金額.str.isnumeric()] 09/05 23:12
推 woogee: 也可以直接修改 09/05 23:14
→ woogee: df.交易金額[~df.交易金額.str.isnumeric()] = 0.0 09/05 23:14