I have function that are implemented inside a class as shown below
Methods.py
class Perform_stats:
def get_mean(self,data):
m = np.mean(data)
return m
def get_rms(self,data):
r = np.sqrt(np.mean(data**2))
return r
....
Testmethods.py
import Methods as mds
ps = mds.Perform_stats()
df_mean = ps.get_mean(df)
df_rms = ps.get_rms(df)
So in Testmethods.py
I need to pass the same data df
to the different function of Perform_stats
class, is it possible to pass the name of the functions that are to be implemented as a list
so that I can call all the functions and get the result as dict
?
Something like as shown below
import Methods as mds
ps = mds.Perform_stats(df,methods=['mean','rms','All']) #All is the default arugument which return a dictionary
I found post which does the same, but I failed to implement my requirement.