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

  • 关于我们
  • 免责声明