Skip to content

Error when demografics data is the first dataset #181

@Paul-B98

Description

@Paul-B98
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

...

/workspaces/.venv/lib/python3.13/site-packages/pyaki/kdigo.py in ?(self, stay_id)
    180         (_, df), *datasets = datasets
    181         for _, _df in datasets:
    182             if isinstance(_df, pd.Series):
    183                 _df = pd.DataFrame([_df], index=df.index)
--> 184             columns = set(_df.columns) - set(df.columns)
    185             df = df.merge(_df[[*columns]], how="outer", left_index=True, right_index=True)
    186 
    187         df["stage"] = df.filter(like="stage").max(axis=1)

/workspaces/.venv/lib/python3.13/site-packages/pandas/core/generic.py in ?(self, name)
   6295             and name not in self._accessors
   6296             and self._info_axis._can_hold_identifiers_and_holds_name(name)
   6297         ):
   6298             return self[name]
-> 6299         return object.__getattribute__(self, name)

AttributeError: 'Series' object has no attribute 'columns'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions