Trouble passing in lambda to apply for pandas DataFrame Trouble passing in lambda to apply for pandas DataFrame python python

Trouble passing in lambda to apply for pandas DataFrame


Note there is no axis param for a Series.apply call, as distinct to a DataFrame.apply call.

Series.apply(func, convert_dtype=True, args=(), **kwds)

func : functionconvert_dtype : boolean, default TrueTry to find better dtype for elementwise function results. If False, leave as dtype=objectargs : tuplePositional arguments to pass to function in addition to the value

There is one for a df but it's unclear how you're expecting this to work when you're calling it on a series but you're expecting it to work on a row?