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 : function
convert_dtype : boolean, default True
Try to find better dtype for elementwise function results. If False, leave as dtype=object
args : tuple
Positional 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?

Leave a Comment