Update app.py
Browse files
app.py
CHANGED
@@ -142,12 +142,18 @@ ui.include_css(app_dir / "styles.css")
|
|
142 |
|
143 |
@reactive.calc
|
144 |
def tips_data():
|
145 |
-
سنی = input.سن() # رنج سنی
|
146 |
-
|
147 |
-
|
|
|
|
|
|
|
|
|
148 |
filtered_data = tips[idx1 & idx2] # دادههای فیلتر شده
|
149 |
-
|
150 |
-
|
|
|
|
|
151 |
|
152 |
@reactive.effect
|
153 |
@reactive.event(input.reset)
|
|
|
142 |
|
143 |
@reactive.calc
|
144 |
def tips_data():
|
145 |
+
سنی = input.سن() # مقدار رنج سنی
|
146 |
+
تاریخ_انتخابی = input.time() # تاریخهای انتخابی
|
147 |
+
print(f"Selected age range: {سنی}")
|
148 |
+
print(f"Selected dates: {تاریخ_انتخابی}")
|
149 |
+
|
150 |
+
idx1 = tips["سن"].between(سنی[0], سنی[1]) # فیلتر بر اساس رنج سنی
|
151 |
+
idx2 = tips["تاریخ"].isin(tاریخ_انتخابی) # فیلتر بر اساس تاریخ انتخابی
|
152 |
filtered_data = tips[idx1 & idx2] # دادههای فیلتر شده
|
153 |
+
|
154 |
+
print(f"Filtered data: {filtered_data}") # چاپ دادههای فیلتر شده
|
155 |
+
|
156 |
+
return filtered_data
|
157 |
|
158 |
@reactive.effect
|
159 |
@reactive.event(input.reset)
|