simplest python equivalent to R's grepl
Question: Is there a simple/one-line python equivalent to R's `grepl` function?

    
    
    strings = c("aString", "yetAnotherString", "evenAnotherOne") 
    grepl(pattern = "String", x =  strings) #[1]  TRUE  TRUE FALSE
    


Answer: You can use list comprehension:

    
    
    strings = ["aString", "yetAnotherString", "evenAnotherOne"]
    
    ["String" in i for i in strings]
    #Out[76]: [True, True, False]
    

Or use `re` module:

    
    
    import re
    
    [bool(re.search("String", i)) for i in strings]
    #Out[77]: [True, True, False]
    

Or with `Pandas` (R user may be interested in this library, using a dataframe
"similar" structure):

    
    
    import pandas as pd
    
    pd.Series(strings).str.contains('String').tolist()
    #Out[78]: [True, True, False]
    

