From ece3c15308c2a77363c58b436c14ca27e8313811 Mon Sep 17 00:00:00 2001 From: Marcin Kuthan Date: Wed, 27 Nov 2024 15:58:19 +0100 Subject: [PATCH] Add TODO for handling timeseries data in trips_totals function --- example/services/ny_tlc_trips_service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/example/services/ny_tlc_trips_service.py b/example/services/ny_tlc_trips_service.py index aab2b36..49daa1f 100644 --- a/example/services/ny_tlc_trips_service.py +++ b/example/services/ny_tlc_trips_service.py @@ -63,6 +63,10 @@ def trips_avg_speed(date_range: tuple[date, date]) -> pd.DataFrame: def _trips_totals(date_range: tuple[date, date]) -> pd.DataFrame: df = ny_tlc_trips_repository.trips_totals(date_range) + # TODO: figure out the best way to handle timeseries data + # df.index = pd.to_datetime(df["day"]) + # df = df.drop(columns=["day"]) + df["payment_type"] = df["payment_type"].fillna(0).astype(int).map(_PAYMENT_TYPES) df["rate_code"] = df["rate_code"].fillna(0).astype(int).map(_RATE_CODES)