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
|
# efficiency kgoe/100km -> ktoe/100km so that after conversion TWh/100km
|
||||||
totals.loc[:, "passenger car efficiency"] /= 1e6
|
totals.loc[:, "passenger car efficiency"] /= 1e6
|
||||||
# convert ktoe to TWh
|
# convert ktoe to TWh
|
||||||
exclude = (
|
patterns = ["passenger cars", ".*space efficiency", ".*water efficiency"]
|
||||||
totals.columns.str.fullmatch("passenger cars")
|
exclude = totals.columns.str.fullmatch("|".join(patterns))
|
||||||
^ totals.columns.str.fullmatch(".*space efficiency")
|
|
||||||
^ totals.columns.str.fullmatch(".*water efficiency")
|
|
||||||
)
|
|
||||||
totals = totals.copy()
|
totals = totals.copy()
|
||||||
totals.loc[:, ~exclude] *= 11.63 / 1e3
|
totals.loc[:, ~exclude] *= 11.63 / 1e3
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user