-1
I’m getting this mistake:
Erro: " 'Series' object has no attribute 'medida' "
Is there any way to put a variable in place of the method and Dataframe recognizes the attribute? Below is the code as I thought it would work.
def desc():
lista_colunas = ['Pclass', 'Age', 'Parch', 'Fare']
lista_medidas = ['mean','max','min','std','var']
for medida in lista_medidas:
for feat in lista_colunas:
df_join[feat + '_' + medida] = df_join[feat].medida()
df_join.head()
desc()
In the
pandas.DataFrame
No! You’d have to do a style gambiarra Monkey patch how to overwrite in Runtime the classpandas.Series
to include the methodpandas.Series.medida()
.– Augusto Vasques