Why do we need to redefine pandas DataFrame after changing columns?
The reason is to allow the option to overwrite the dataframe object you are working on, or to leave it unchanged by creating a copy and assigning it to a different variable. The option is valuable as depending on the circumstances you may want to directly modify the original data or not.
The inplace parameter is one way in which you have the power to choose between the two options.
I just wondered why Pandas DataFrame class functions do not change their instance.
For example, if I use pd.DataFrame.rename(), dropn(), I need to update the instance by redefining it. However, if its class is list, you can delete an element by a pop() method without redefining it. The function changes its intrinsic instance.
Is there a reason why pandas or numpy use this kind of style?
Can you explain why this kind of styling is better or its advantages?