Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

Fix splitting behavior when multiple runs of the splitting variable are present #16

Open
qitianshi opened this issue Dec 17, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@qitianshi
Copy link
Owner

See FIXME, line 17:

def __split_variable(
data: pd.DataFrame,
var: str,
reset_t: bool = True
) -> dict[float, pd.DataFrame]:
""""Splits data by a variable."""
#FIXME: This code will group all rows with the same value of var together;
# expected behavior is that different groups should be separated.
unique_values = data[var].unique()
extracted_data = {}
for phi in unique_values:
extract = data[data[var] == phi].reset_index(drop=True)
if reset_t:
initial_t = extract.at[0, "t"]
extract["t"] -= initial_t
extracted_data[phi] = extract
return extracted_data

@qitianshi qitianshi self-assigned this Dec 24, 2021
@qitianshi qitianshi added the bug Something isn't working label Jan 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant