I have a dataframe with different info about arrests.
arrests_df["is_violent"] = [
1 if x == "Battery" or x == "Assault" else 0 for x in arrests_df["statute_desc"]
]
So in the column called "statute_desc", every time the word battery or assault is mentioned, put 1. But this code doesn't work.