'Pandas DataFrame as an Argument to a Function - Python

Suppose a Pandas DataFrame is passed to a function as an argument. Then, does Python implicitly copy that DataFrame or is the actual DataFrame being passed in?

Hence, if I perform operations on the DataFrame within the function, will I be changing the original (because the references are still intact)?

I just want to know whether or not I should make a Deep Copy of my DataFrame before passing it into a function and operating on it.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source