
def gran_arbre(df, pob, econs):
    df2 = df[(df.Town==pob) & (df.Condition==econs)]
    idxg = df2['Trunk'].idxmax()
    gran = df.loc[idxg]
    return gran['Common_Name'], gran['Trunk'], gran['Height']

def noms_comuns1(df):
    aux = df.set_index('Species_Desc')
    s = aux['Common_Name'].dropna()
    return s.to_dict()

def noms_comuns2(df):
    g = df.groupby('Species_Desc')
    dfaux = g['Common_Name'].apply(lambda v:v.iloc[0])
    return dfaux.dropna().to_dict()

def noms_comuns3(df):
    df2 = df[['Common_Name', 'Species_Desc']]
    df2 = df2.set_index('Species_Desc')
    df2 = df2.drop_duplicates().dropna()
    return df2['Common_Name'].to_dict()

# Tria la solució que vols provar
noms_comuns = noms_comuns3

