I have predefined a function that uses pandas, for which, the import is done at the beginning of the code. Dfs are created normally on the first iteration of the function, but throws an AttributeError on the next iteration of the function. Only when re-import pandas does it work again, only once, before throwing the same error on the second iteration.
As an FYI, the only usage of pd in the function is to generate a dataframe object directly prior to the return function.
3