This PR gets rid of another occurrence of using the for_each_belief method (which uses a groupby internally). It also makes sure that the underlying computation, which is now based on the faster value_counts method, is reused.
I wish I had discovered df.droplevel("cumulative_probability").index.value_counts() before. Likewise for Pandas' cache_readonly.
This PR gets rid of another occurrence of using the
for_each_belief
method (which uses agroupby
internally). It also makes sure that the underlying computation, which is now based on the fastervalue_counts
method, is reused.I wish I had discovered
df.droplevel("cumulative_probability").index.value_counts()
before. Likewise for Pandas'cache_readonly
.