Issue
With this function:
def df_printer(*args):
print(#DATAFRAME NAMED BALANCES#)
and 3 dataframes passed to the function:
df_printer(users, orders, balances)
Is there any way to reference these dataframes other than it's position? Can I reference them by name somehow? In this case, the balances df.
Solution
If you use **kwargs
you can have a variable amount of keyword arguments accessible as a dictionary:
def df_printer(**kwargs):
print(kwargs["balances"])
df_printer(users=users, orders=orders, balances=balances)
Answered By - Xnot
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.