Spaces:
Runtime error
Runtime error
change date range
Browse files
utils.py
CHANGED
@@ -16,8 +16,10 @@ def load_and_preprocess_data():
|
|
16 |
# but to keep things simple it quite good.
|
17 |
df = df[df["Quantity"] > 0]
|
18 |
|
19 |
-
# Parse the date column
|
20 |
-
df["InvoiceDate"] = pd.to_datetime(df["InvoiceDate"]).dt.floor(
|
|
|
|
|
21 |
|
22 |
# Change customer id to int
|
23 |
df["CustomerID"] = df["CustomerID"].astype(int)
|
|
|
16 |
# but to keep things simple it quite good.
|
17 |
df = df[df["Quantity"] > 0]
|
18 |
|
19 |
+
# Parse the date column and add 10 years, just to better visualization
|
20 |
+
df["InvoiceDate"] = pd.to_datetime(df["InvoiceDate"]).dt.floor(
|
21 |
+
"d"
|
22 |
+
) + pd.offsets.DateOffset(years=10)
|
23 |
|
24 |
# Change customer id to int
|
25 |
df["CustomerID"] = df["CustomerID"].astype(int)
|