>>> from satisfaccio import * >>> nomf = 'satisfaccio.csv' >>> df = llegir_csv(nomf) >>> df P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 0 1 1 1 5 5 4 5 2 1 3 1 4 5 5 1 1 3 5 3 2 4 2 3 5 3 5 1 2 5 4 1 4 3 3 5 3 4 2 1 5 1 3 3 >>> selecciona_index(df, 2, 'P3') 3 >>> selecciona_fila(df, 2) P1 3 P2 5 P3 3 P4 5 P5 1 P6 2 P7 5 P8 4 P9 1 P10 4 Name: 2, dtype: int64 >>> dsel = selecciona_parell(df) >>> dsel P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 0 1 1 1 5 5 4 5 2 1 3 2 3 5 3 5 1 2 5 4 1 4 >>> dsel = selecciona_columnes(df, ['P1', 'P2', 'P3']) >>> dsel P1 P2 P3 0 1 1 1 1 4 5 5 2 3 5 3 3 3 5 3 >>> dsel = selecciona_valor(df, 'P1', 3) >>> dsel P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 2 3 5 3 5 1 2 5 4 1 4 3 3 5 3 4 2 1 5 1 3 3 >>> mit, des = estadistiques(df, 'P4') >>> round(mit, 3), round(des, 3) (3.75, 1.893) >>> pmv = mes_valorada(df) >>> pmv 'P7' >>> est = totes_estadistiques(df) >>> est.index Index(['count', 'mean', 'std', 'min', '25%', '50%', '75%', 'max'], dtype='object') >>> est[['P1', 'P10']] P1 P10 count 4.000000 4.00000 mean 2.750000 3.50000 std 1.258306 0.57735 min 1.000000 3.00000 25% 2.500000 3.00000 50% 3.000000 3.50000 75% 3.250000 4.00000 max 4.000000 4.00000 >>> est.loc['std'] P1 1.258306 P2 2.000000 P3 1.632993 P4 1.892969 P5 1.892969 P6 1.290994 P7 0.000000 P8 1.290994 P9 0.957427 P10 0.577350 Name: std, dtype: float64 >>> float(est.loc['std'].sum()) 12.794004072685