I want to pass a DataFrame (df1) to a function. In the function the DataFrame gets changed. This change should not be applied to the original (df1). In c++ I can pass variables to functions with call_by_value. Unfortunately I don't get this pass in python.
def func1(df):
#Change some values in the DataFrame
df1 = pd.DataFrame(some content...)
func1(df1) #df1 gets passed to func1
print(df1) #df1 does not have the same content after the function call as before the function call
The content in df1 should only be changed inside the function. When i print the DataFrame after i ran the function, it should have the same values like before