I have a certain pandas data frame that looks like this:
| x | y | unit ID | leak/min | |
|---|---|---|---|---|
| 0 | 12 | 34 | 1 | 3.3 |
| 1 | 99 | 42 | 1 | 2.33 |
| 2 | 45 | 55 | 3 | 3.11 |
It runs upto 400 entries.
I would like to create a function that determines the number of unique units and then return a dictionary with subsets of the data frame. So the key is a string with unit IDs and each value is the dataframe of a subset of the original data frame.
I know how to find the unique values using this code; uniqueValues = data['ID'].unique() but having problems implementing the dictionary.