Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 8, 2024
1 parent b178af3 commit 0237d08
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions scripts/process_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,15 @@ def buses_from_lines(lines, geocode=True):
lambda s: re.sub(r"([a-z])([A-Z])", r"\1 \2", s) if isinstance(s, str) else s
)
buses["name"] = buses.name.apply(
lambda s: s.replace("ue", "ü")
.replace("ae", "ä")
.replace("oe", "ö")
.replace("Itzehö", "Itzehoe")
.replace("Daürsberg", "Dauersberg")
if isinstance(s, str) and s[-2:] in ["DE", "AT"]
else s
lambda s: (
s.replace("ue", "ü")
.replace("ae", "ä")
.replace("oe", "ö")
.replace("Itzehö", "Itzehoe")
.replace("Daürsberg", "Dauersberg")
if isinstance(s, str) and s[-2:] in ["DE", "AT"]
else s
)
)
if geocode:
buses = pd.concat([buses, buses.name.apply(locate)], axis=1)
Expand Down

0 comments on commit 0237d08

Please sign in to comment.