Skip to content
This repository was archived by the owner on Sep 7, 2024. It is now read-only.
This repository was archived by the owner on Sep 7, 2024. It is now read-only.

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

@qitianshi

Description

@qitianshi

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions