older pandas
Browse files- app.py +6 -2
- requirements.txt +1 -1
app.py
CHANGED
@@ -34,11 +34,15 @@ def prepare_data():
|
|
34 |
tools_df = pd.read_parquet("./data/tools.parquet")
|
35 |
trades_df = pd.read_parquet("./data/all_trades_profitability.parquet")
|
36 |
|
|
|
|
|
|
|
37 |
tools_df['request_time'] = pd.to_datetime(tools_df['request_time'])
|
38 |
-
|
|
|
39 |
|
40 |
trades_df['creation_timestamp'] = pd.to_datetime(trades_df['creation_timestamp'])
|
41 |
-
trades_df = trades_df[trades_df['creation_timestamp'].dt.
|
42 |
|
43 |
trades_df = prepare_trades(trades_df)
|
44 |
return tools_df, trades_df
|
|
|
34 |
tools_df = pd.read_parquet("./data/tools.parquet")
|
35 |
trades_df = pd.read_parquet("./data/all_trades_profitability.parquet")
|
36 |
|
37 |
+
# get current month
|
38 |
+
current_month = datetime.now().strftime("%Y-%m")
|
39 |
+
|
40 |
tools_df['request_time'] = pd.to_datetime(tools_df['request_time'])
|
41 |
+
# only keep trades for the current month
|
42 |
+
tools_df = tools_df[tools_df['request_time'].dt.strftime('%Y-%m') == current_month]
|
43 |
|
44 |
trades_df['creation_timestamp'] = pd.to_datetime(trades_df['creation_timestamp'])
|
45 |
+
trades_df = trades_df[trades_df['creation_timestamp'].dt.strftime('%Y-%m') == current_month]
|
46 |
|
47 |
trades_df = prepare_trades(trades_df)
|
48 |
return tools_df, trades_df
|
requirements.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
pandas
|
2 |
matplotlib
|
3 |
huggingface-hub
|
4 |
pyarrow
|
|
|
1 |
+
pandas==2.0.1
|
2 |
matplotlib
|
3 |
huggingface-hub
|
4 |
pyarrow
|