1.12. Ordfordeling#
from dhlab.text.dispersion import Dispersion
from dhlab import Corpus
dracula = Dispersion(
urn="URN:NBN:no-nb_digibok_2011071108102",
wordbag=["Dracula", "Helsing", "Mina", "Jonathan"],
window=5000,
pr=500
)
dracula.dispersion
Dracula | Helsing | Mina | Jonathan | |
---|---|---|---|---|
0 | 5 | 0 | 3 | 1 |
1 | 4 | 0 | 2 | 0 |
2 | 2 | 0 | 1 | 0 |
3 | 2 | 0 | 1 | 0 |
4 | 0 | 0 | 1 | 1 |
... | ... | ... | ... | ... |
374 | 1 | 3 | 23 | 6 |
375 | 1 | 3 | 19 | 6 |
376 | 1 | 3 | 15 | 6 |
377 | 1 | 3 | 14 | 11 |
378 | 1 | 3 | 12 | 10 |
379 rows × 4 columns
dracula.plot(alpha=0.8, lw=2)