Generation

generate functionThu, 16 Feb 2023

There is a Pandas Series column: 10 78 54 GOOD 64 23 Write a function that finds all rows with letters in the Series column. Example: find_non_numbers(df, 'loan_amnt') Result: GOOD

def find_non_numbers(df, col): return df[df[col].apply(lambda x: x.isalpha())]

Questions about programming?Chat with your personal AI assistant