I want to create a function by using lambda and apply tools. In this function, it should return "1.30" or "0" according to the condition. If in the column value is greater than 30, it returns "1.30" not "0". After that, I have to implement this function to the elements in the column.
I've tried something but I could not. Let me show you what I did before:
def catch(column_name):
if column_name < 30:
print("1.30")
else:
print("0")
df.loc[:,df.columns.str.contains("age")].apply(lambda catch: catch > 30)
When I type like that, just shows me True or False. I don't want this