DataFrame modified inside a function
def test(df): df = df.copy(deep=True) df[‘tt’] = np.nan return df If you pass the dataframe into a function and manipulate it and return the same dataframe, you are going to get the same dataframe in modified version. If you want to keep your old dataframe and create a new dataframe with your modifications then by … Read more