You can go with @greenAfrican example, if it's possible for you to rewrite your function. But if you don't want to rewrite your function, you can wrap it into anonymous function inside apply, like this:

>>> def fxy(x, y):
...     return x * y

>>> df['newcolumn'] = df.apply(lambda x: fxy(x['A'], x['B']), axis=1)
>>> df
    A   B  newcolumn
0  10  20        200
1  20  30        600
2  30  10        300
Answer from roman on Stack Overflow
🌐
Medium
ogungbireadedolapo.medium.com › passing-multiple-arguments-into-pandas-apply-function-3d9cf89d95cc
Passing multiple arguments into Pandas Apply function | by Ogungbire Adedolapo | Medium
September 22, 2022 - The task is to create a new column “New Var” that contains the result of multiplying the age and fare of the individual if its a male and same variable stores the result of adding the age of the individual with their fare if female. While there might be multiple ways to achieve this, we’ll be making use of pandas apply function.
🌐
IncludeHelp
includehelp.com › python › pandas-apply-function-with-two-arguments-to-columns.aspx
Python - Pandas apply function with two arguments to columns
December 21, 2023 - To use apply() method to pass a function that accepts two arguments, we will simply use apply() method inside which we can use either the lambda function to operate the function on each value or we can directly apply the function on any particular column value.
🌐
DigitalOcean
digitalocean.com › community › tutorials › pandas-dataframe-apply-examples
Pandas DataFrame apply() Examples | DigitalOcean
August 3, 2022 - This is helpful when we have to pass additional keyword arguments to the function. Let’s look at some examples of using apply() function on a DataFrame object. import pandas as pd df = pd.DataFrame({'A': [1, 2], 'B': [10, 20]}) def square(x): return x * x df1 = df.apply(square) print(df) print(df1)
🌐
IncludeHelp
includehelp.com › python › how-to-apply-a-function-with-multiple-arguments-to-create-a-new-pandas-column.aspx
How to apply a function with multiple arguments to create a new Pandas column?
September 22, 2023 - A simple comprehension function or lambda function can be used to continuously call the function with multiple arguments. ... # Importing pandas package import pandas as pd # Creating a dictionary d = {"A": [10, 20, 30, 40], "B": [50, 60, 70, 80]} # Creating a DataFrame df = pd.DataFrame(d) ...
🌐
Reddit
reddit.com › r/learnpython › [pandas] why no argument required in apply() function?
r/learnpython on Reddit: [Pandas] Why no argument required in apply() function?
February 28, 2022 -
import pandas as pd

myDF = pd.DataFrame({'student_names':['Monserta ruff','Gonzalo Fryer','Kris Venmeter'],'grades':[34,58,100]})

def assign_letter(row):
    if row >= 90:
        result = 'A**'
    elif row >=50:
        result = 'C'
    else:
        result ='F'
    return result
myDF['letter-grades'] = myDF['grades'].apply(assign_letter) #no argument required?
myDF

Why doesn't the function assign_letter(row) require an argument (no parenthesis) but it still gives the CORRECT Resultant DF (as below)?

student_namesgradesletter_grades
Monserta ruff34F
Gonzalo Fryer58C
Kris Venmeter100A**

Find elsewhere
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.Series.apply.html
pandas.Series.apply — pandas 3.0.1 documentation - PyData |
Define a custom function that needs additional positional arguments and pass these additional arguments using the args keyword. >>> def subtract_custom_value(x, custom_value): ... return x - custom_value · >>> s.apply(subtract_custom_value, args=(5,)) London 15 New York 16 Helsinki 7 dtype: int64
🌐
Pandas
pandas.pydata.org › pandas-docs › version › 0.20.2 › generated › pandas.DataFrame.apply.html
pandas.DataFrame.apply — pandas 0.20.2 documentation
Enter search terms or a module, class or function name. DataFrame.apply(func, axis=0, broadcast=False, raw=False, reduce=None, args=(), **kwds)[source]¶
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-apply-a-function-to-multiple-columns-in-pandas
How to Apply a function to multiple columns in Pandas? - GeeksforGeeks
July 15, 2025 - # import the module import pandas as pd # creating a DataFrame df = pd.DataFrame({'String 1' :['Tom', 'Nick', 'Krish', 'Jack'], 'String 2' :['Jane', 'John', 'Doe', 'Mohan']}) # function for prepending 'Geek' def prepend_geek(name): return 'Geek ' + name # executing the function df[["String 1", "String 2"]] = df[["String 1", "String 2"]].apply(prepend_geek) # displaying the DataFrame display(df) ... Here, we are multiplying all the columns by 2 by calling the multiply_by_2 function.
🌐
Medium
medium.com › @deallen7 › how-to-apply-a-function-with-two-or-more-arguments-in-a-pandas-dataframe-ea80abe68976
How to Apply a Function with Two (or more) Arguments in a Pandas DataFrame | by David Allen | Medium
August 16, 2023 - In this short tutorial, I’ll show you exactly how to apply a function that will accept both one argument and multiple arguments in a Pandas Dataframe.
🌐
W3docs
w3docs.com › python
How to apply a function to two columns of Pandas dataframe
You can also use the apply() method to apply a function that takes multiple arguments to a DataFrame. To do this, you can define the function with multiple arguments and pass the columns to the function as separate arguments.
🌐
CopyProgramming
copyprogramming.com › howto › how-to-apply-a-function-that-takes-multiple-arguments-to-a-pandas-dataframe
Python: Applying a Function with Multiple Arguments to a Pandas DataFrame: A Guide
June 1, 2023 - The primary concern is that, in apply , the complete Series is passed as a single argument. The recommended code is sumit(s,... instead of sumit(a, b, ...) , with s representing the Series . Afterwards, expand the sequence within the function. ... Use axis=1 instead of the default axis=0 for ...
🌐
Pandas
pandas.pydata.org › pandas-docs › stable › reference › api › pandas.Series.apply.html
pandas.Series.apply — pandas 2.2.2 documentation - PyData |
Define a custom function that needs additional positional arguments and pass these additional arguments using the args keyword. >>> def subtract_custom_value(x, custom_value): ... return x - custom_value · >>> s.apply(subtract_custom_value, args=(5,)) London 15 New York 16 Helsinki 7 dtype: int64
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.DataFrame.apply.html
pandas.DataFrame.apply — pandas 3.0.1 documentation
However if the apply function returns a Series these are expanded to columns. ... Positional arguments to pass to func in addition to the array/series. ... Only has an effect when func is a listlike or dictlike of funcs and the func isn’t a string. If “compat”, will if possible first translate the func into pandas methods (e.g. Series().apply(np.sum) will be translated to Series().sum()). If that doesn’t work, will try call to apply again with by_row=True and if that fails, will call apply again with by_row=False (backward compatible).
🌐
Spark By {Examples}
sparkbyexamples.com › home › pandas › pandas series apply() function usage
Pandas Series apply() Function Usage - Spark By {Examples}
June 30, 2025 - The function allows three parameters func, convert_dtype, and args. In this article, I will explain how to use pandas apply() function with arguments to a series by using Series.apply() function.