Skip to content

Commit a04e57a

Browse files
committed
Clean up package
1 parent fe23beb commit a04e57a

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

model/01-train-and-deploy-model/requirements.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ scikit-learn==1.2.2
66
vetiver==0.2.1
77
ipykernel==6.23.1
88
pyodbc==4.0.39
9-
git+https://github.com/sol-eng/bike_predict_python.git@samedwardes/bug-fixes#subdirectory=package
9+
10+
# Install the `bikeshare` package. To bump the version install from a
11+
# new comment hash. E.g. update this string:
12+
# @4964b11c6e0bb5f70bfafc28c24234ce8c6b11f5
13+
git+https://github.com/sol-eng/bike_predict_python.git@fe23beb4f081a163cd30cbeede06808d4bc4decc#subdirectory=package

package/bikeshare/data.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
def clean_data(df: pd.DataFrame) -> pd.DataFrame:
55
out = df.copy()
66

7-
# Clean the date column
8-
out['date'] = pd.to_datetime(out['date'])
9-
10-
# Specify categories for dow
7+
# Specify all possible values for day of week.
118
days_of_week = [
129
'Monday',
1310
'Tuesday',
@@ -17,12 +14,14 @@ def clean_data(df: pd.DataFrame) -> pd.DataFrame:
1714
'Saturday',
1815
'Sunday'
1916
]
17+
18+
# Turn down into a categorical.
2019
out['dow'] = pd.Categorical(
2120
out['dow'],
2221
categories=days_of_week
2322
)
2423

25-
# One hot encode dow column
24+
# One hot encode dow column.
2625
out = pd.get_dummies(out, prefix=[""], prefix_sep="", columns = ['dow'])
2726

2827
# Select final columns

0 commit comments

Comments
 (0)