So this is my first question here. Please let me know what style guides I failed to use. :)
I have a dataframe and within a function, I create a copy and work with this copy inside the function. Calling the function the first time works fine. The second time gives an error.
df_general = pd.read_excel("somedata.xlsx")
def my_func():
df_within = df_general
# some work with df_within, e.g. adding a column
return
Reason I found: df_within
is not set back to df_general
- seems like the statement df_within = df_general
is not taken up (but is taken up during first time using the function)
Any ideas? Thanks!