I'm a following a pandas tutorial and came across with the function "apply". I already have one column ("speaker name") with random values and I'd like to update its rows based on the values on another row. My code is:
df["speaker name"].apply(lambda row: "cian" if df["speaker id"]==5)
Python output:
df["speaker name"].apply(lambda row: "cian" if df["speaker id"]==5)
^
SyntaxError: invalid syntax
could you help me with this?
Thanks