shannon entropy formula python