-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional methods and fixes to DataFrameMixin #43
Conversation
- create set_cells at DiscreteSpaceDF level
- created concrete swap in SpaceDF - update due to changes in mixin
- add remaining capacity property - branching _update_capacity in cells and agents
- added some useful method (add, all, div, drop_columns, drop_duplicates, group_by_cum_count, mul, norm, reset_index, set_index, srs_to_df) - minor fixes
- fixes to the logic of some methods
…nts are already present, the second if agents aren't already present - Fixes to the logic of some methods of SpaceDF (random_agents, swap_agents), DiscreteSpaceDF (__repr__, __str__) GridDF (__init__, get_directions, get_distances, get_neighbors, get_neighborhood, get_cells, out_of_bounds, remove_agents, torus_adj, _compute_offsets, _get_df_coords)
…act DataFrameMixin
- added custom _empty_cell_condition - fixed the logic of some methods (_generate_empty_grid, _sample_cells, _update_capacity_agents, remaining_capacity)
… 34-concrete-gridpandas
… 34-concrete-gridpandas
… 34-concrete-gridpandas
Tangent: it seems to me it could be its useful own package for a general DF with either pandas or Polars backend. Useful for people who can't decide which one to use, like us, haha. Otherwise, to add a selling point, we could implement R's dplyr-style grammar of data manipulation. Though there is already https://github.com/machow/siuba. |
Agree! A separate package with a unique interface for any DF library could be worthwile, especially since there are methods which are almost the same with only a name change. However right now I wrote up just the methods I needed so far. We can think about it when the library is a bit more mature. |
This PR adds some useful methods to DataFrameMixin and fixes the logic of some methods in pandas and polars.
Added methods: