“pivot_table value aggfunct” Respostas de código

Pandas DF por índice de linha

indices = [133, 22, 19, 203, 14, 1]
df_by_indices = df.iloc[indices, :]
russhopper

pivot_table value aggfunct

table = pd.pivot_table(df, values=['D', 'E'], index=['A', 'C'],
...                     aggfunc={'D': np.mean,
...                              'E': [min, max, np.mean]})
>>> table
                D    E
            mean  max      mean  min
A   C
bar large  5.500000  9.0  7.500000  6.0
    small  5.500000  9.0  8.500000  8.0
foo large  2.000000  5.0  4.500000  4.0
    small  2.333333  6.0  4.333333  2.0
Tense Tarsier

Respostas semelhantes a “pivot_table value aggfunct”

Perguntas semelhantes a “pivot_table value aggfunct”

Mais respostas relacionadas para “pivot_table value aggfunct” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código