logo
  • 教程列表
  • SO官方文檔
  • 字串操作
    • 正規表示式
    • 字串的大寫
    • 檢查字串的內容
    • 切片字串
  1. StackOverflow 文件
  2. pandas 教程
  3. 字串操作
  4. 正規表示式

正規表示式

Created: November-22, 2018

# Extract strings with a specific regex
df= df['col_name'].str.extract[r'[Aa-Zz]']

# Replace strings within a regex
df['col_name'].str.replace('Replace this', 'With this')

有關如何使用正規表示式匹配字串的資訊,請參閱正規表示式入門 。

  • 字串的大寫
  • 字串操作

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明