Pregunta:
Dato : heroes = pd.read_csv('data/heroes.csv', sep=';', index_col=0) heroes_with_year = heroes[heroes['First appearance'] < 2020] trasforma le frequenze da assolute a relative
Autor: federico volpeRespuesta:
Publisher_abs_freq = pd.crosstab(index=heroes_with_year['Publisher'], columns=['Rel. frequence'], colnames=['']) publisher_rel_freq = publisher_abs_freq / publisher_abs_freq.sum() publisher_rel_freq ---------------------------------------oppure:--------------------------------------- publisher_rel_freq = pd.crosstab(index=heroes_with_year['Publisher'], columns=['Rel. frequence'], colnames=[''], normalize=True) publisher_rel_freq
0 / 5 (0 calificaciones)
1 answer(s) in total