Apply a method from a list of methods to pandas dataframe
问题 this is my first question here so please be patient with me. My problem is as follows: Assume we have a pandas Dataframe and we want to apply dynamically some pd.Series methods to a set of columns of this Dataframe. Why the following example doesn't work? testframe=pd.DataFrame.from_dict({'col1': [1,2] ,'col2': [3,4] }) funcdict={'col1':[pd.Series.astype,str.replace],'col2':[pd.Series.astype,str.replace]} argdict= {'col1':[['str'],['1','A']],'col2':[['str'],['3','B']]} for col in testframe