SeitaBV / timely-beliefs

Model data as beliefs (at a certain time) about events (at a certain time).
MIT License
34 stars 6 forks source link

Use value_counts() #135

Closed Flix6x closed 1 year ago

Flix6x commented 1 year ago

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.