pandas.DataFrame.apply — pandas 1.3.5 documentation
pandas.pydata.org › pandaspandas.DataFrame.apply. ¶. DataFrame.apply(func, axis=0, raw=False, result_type=None, args=(), **kwargs) [source] ¶. Apply a function along an axis of the DataFrame. Objects passed to the function are Series objects whose index is either the DataFrame’s index ( axis=0) or the DataFrame’s columns ( axis=1 ). By default ( result_type=None ), the final return type is inferred from the return type of the applied function.
pandas.Series.apply — pandas 1.3.5 documentation
pandas.pydata.org › api › pandaspandas.Series.apply¶ Series. apply (func, convert_dtype = True, args = (), ** kwargs) [source] ¶ Invoke function on values of Series. Can be ufunc (a NumPy function that applies to the entire Series) or a Python function that only works on single values. Parameters func function. Python function or NumPy ufunc to apply. convert_dtype bool, default True