Filter a Pandas Dataframe column by string

    0

    0

    Javier Pacheco

    The df[df['column'].str.contains('filter')] function will return a boolean indicating whether the string 'filter' is found anywhere in the column value.

    import pandas as pd
    
    df[df['column'].str.contains('filter')]
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.