I am using Python 2.7 from the Anaconda distro. I am trying to organize a complex data integration process into different classes and functions so I can better manage it.
As a simplified example, I have some part of my process in a file called function_test.py
import pandas as pd
import numpy as np
class Perform:
def work(self):
test_df = pd.DataFrame(np.random.randn(10,4), columns=['a','b','c','d'])
print "really?"
print test_df
I want to call and execute the above logic from function_call.py which is in the same directory:
import function_test
perform = function_test.Perform
perform.work
However, when I execute function_call.py I get the following message and nothing is printed.
UMD has deleted: function_test
How do I set this example up so function_test is imported and executed so test_df is available from within function_call.py?
Any advice is appreciated.