Entfernen redunanter Sortierfunktion
Entfernen nicht benötigter Importe
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import math
|
||||
from operator import concat
|
||||
|
||||
empty_element = {
|
||||
"count" : 1,
|
||||
@@ -105,8 +104,8 @@ def calculate(elements, m, message):
|
||||
reverse=True
|
||||
))
|
||||
# Ausgabe
|
||||
for x_i in sorted_by_information:
|
||||
print(f"{elements[x_i]["count"]:3.0f} | {elements[x_i]["I(x_i)"]:15.12f} | »{x_i}«")
|
||||
for x_i in sorted_by_element:
|
||||
print(f"{elements[x_i]["count"]:3.0f} | {elements[x_i]["p(x_i)"]:10.7f} | {elements[x_i]["I(x_i)"]:10.7f} | »{x_i}«")
|
||||
print("Entropie der Nachricht = " + h.__str__() + "\n\n")
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user