Add .pyc to .gitignore.
Convert weights to required format (matrix).
Fix _compute_distributions to work with weights.