simplify exclude statement
Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
This commit is contained in:
parent
649e48e1a9
commit
0ac6a6a1f2
@ -612,11 +612,8 @@ def build_idees(countries: List[str]) -> pd.DataFrame:
|
||||
# efficiency kgoe/100km -> ktoe/100km so that after conversion TWh/100km
|
||||
totals.loc[:, "passenger car efficiency"] /= 1e6
|
||||
# convert ktoe to TWh
|
||||
exclude = (
|
||||
totals.columns.str.fullmatch("passenger cars")
|
||||
^ totals.columns.str.fullmatch(".*space efficiency")
|
||||
^ totals.columns.str.fullmatch(".*water efficiency")
|
||||
)
|
||||
patterns = ["passenger cars", ".*space efficiency", ".*water efficiency"]
|
||||
exclude = totals.columns.str.fullmatch("|".join(patterns))
|
||||
totals = totals.copy()
|
||||
totals.loc[:, ~exclude] *= 11.63 / 1e3
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user