'how to create a dataset readable for information theory package (dit) in python?

I am going to use dit package (https://dit.readthedocs.io/en/latest/generalinfo.html) to do some statistic calculations. I created data set in format like this outcomes_probs = {'000': 1/4, '011': 1/4, '101': 1/4, '110': 1/4}. I have 3 out put same as example but problem is that some of the outcomes are bigger than 10 so I have outcomes like this '2212': 0.0 which is 3 outcome from 3 event with values 2,2,12 respectively. but "dit" package consider it as outcome from 4 even with values 2,2,1,2 and give me this error message. "Not all outcomes have the same length." dose anyone know how to solve this problem? Thank you for your help.



Solution 1:[1]

An outcome of 0.0 will not be included in the alphabet. Nevertheless, I suggest using the dit.Distribution.from_ndarray() function to enter distributions. So long as you input an np array of probabilites p(x), dit will populate an alphabet.

I'm glad someone else thinks their documentation is awful. I'll get back to you with more later. I think their brief github documentation is almost more substantive for beginners

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Daniel Morgan