diff --git a/activity_browser/bwutils/superstructure/activities.py b/activity_browser/bwutils/superstructure/activities.py index 97c990012..ead625063 100644 --- a/activity_browser/bwutils/superstructure/activities.py +++ b/activity_browser/bwutils/superstructure/activities.py @@ -91,7 +91,8 @@ def get_relevant_activities(df: pd.DataFrame, part: str = "from") -> dict: if sub.empty: return {} - names, products, locations, dbs = sub.iloc[:, 0:4].apply(set, axis=0) + names, products, locations, dbs = list(map(set, sub.iloc[:, 0:4].values.T)) +# names, products, locations, dbs = sub.iloc[:, 0:4].apply(set, axis=0) query = (ActivityDataset .select(ActivityDataset.name, ActivityDataset.product, ActivityDataset.location, ActivityDataset.database, @@ -113,7 +114,8 @@ def get_relevant_flows(df: pd.DataFrame, part: str = "from") -> dict: if sub.empty: return {} - names, categories, dbs = sub.iloc[:, 0:3].apply(set, axis=0) + names, categories, dbs = list(map(set, sub.iloc[:, 0:3].values.T)) +# names, categories, dbs = sub.iloc[:, 0:3].apply(set, axis=0) query = (ActivityDataset .select(ActivityDataset.name, ActivityDataset.data, ActivityDataset.database, ActivityDataset.code) diff --git a/activity_browser/bwutils/superstructure/excel.py b/activity_browser/bwutils/superstructure/excel.py index 9d6435c24..e009c624f 100644 --- a/activity_browser/bwutils/superstructure/excel.py +++ b/activity_browser/bwutils/superstructure/excel.py @@ -83,7 +83,7 @@ def import_from_excel(document_path: Union[str, Path], import_sheet: int = 1) -> # Convert specific columns that may have tuples as strings columns = ["from categories", "from key", "to categories", "to key"] - data.loc[:, columns] = data[columns].applymap(convert_tuple_str) + data.loc[:, columns] = data[columns].map(convert_tuple_str) except: # skip the error checks here, these now occur in the calling layout.tabs.LCA_setup module pass