title: How to calculate expected values for a column using Poisson distribution & then compare with actual values?
body: <p>I have a dataframe which contains the results of different games played. I need to calculate the expected results(how many games result with the same score) with Poisson distribution then compare actual results with expected results.So, imagine I have 2 games that resulted in result = 2, 4 games resulted in result = 9 and so on. I need expected results corresponding to actual values in terms of number of games resulted in a certain result.</p>
  
  <p>I calculated the mean of the results column which I read also is called the expected value. Plotted a histogram of actual results.</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  # Game Results DataFrame
  game_results = pd.DataFrame({"game_id":[56,57,58,59,60],"result":[0,9,4,6,8]})
  print(game_results)
  
  # Histogram for result column
  
  result = game_results["result"]
  
  plt.hist(result)
  plt.xlabel("Result")
  plt.ylabel("Number of Games")
  plt.title("Result Histogram")
  
  lamb = result.mean()
  </code></pre>