We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
merge_flows_to_self
1 parent e3f3bbc commit e3ec3bbCopy full SHA for e3ec3bb
1 file changed
activity_browser/bwutils/superstructure/manager.py
@@ -276,17 +276,7 @@ def merge_flows_to_self(df: pd.DataFrame) -> pd.DataFrame:
276
-------
277
A pandas dataframe with the changes made to the scenario dataframe for these self referential flows
278
"""
279
- self_referential_production_flows = df.loc[
280
- df.apply(
281
- lambda x: (
282
- True
283
- if x["from key"] == x["to key"] and x["flow type"] == "technosphere"
284
- else False
285
- ),
286
- axis=1,
287
288
- :,
289
- ].copy()
+ self_referential_production_flows = df[(df["from key"] == df["to key"]) & (df["flow type"] == "technosphere")].copy()
290
self_referential_production_flows.index = pd.MultiIndex.from_arrays(
291
[
292
self_referential_production_flows.index.get_level_values(0),
0 commit comments