SHELLAPANDIANGANHUNGING commited on
Commit
75526ad
·
verified ·
1 Parent(s): 513d2a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -320,6 +320,15 @@ with st.sidebar:
320
  else:
321
  alarms = alarm_options
322
 
 
 
 
 
 
 
 
 
 
323
  submit = st.button("Submit")
324
 
325
  # Apply filters
@@ -330,10 +339,11 @@ if submit:
330
  if positions: dff = dff[dff['Position'].astype(int).isin(positions)]
331
  if tyre_types: dff = dff[dff['Tyre Type'].isin(tyre_types)]
332
  if alarms: dff = dff[dff['Alarm Status'].isin(alarms)]
 
 
333
  else:
334
  dff = df
335
 
336
-
337
  # ================= OBJECTIVE 1 =================
338
  # ================= OBJECTIVE 1 =================
339
  # st.markdown('<h3 class="objective-title">OBJECTIVE 1: Pressure & Temperature Trends — How Do Front and Rear Tyres Distributin?</h3>', unsafe_allow_html=True)
@@ -810,7 +820,7 @@ with col2:
810
 
811
  if not front_df.empty:
812
  # Filter kecepatan > 0 untuk hindari pembagian dengan nol
813
- front_df = front_df[front_df['Speed (km/h)'] > 0]
814
  front_df['Temp_Speed_Ratio'] = front_df['Temperature (°C)'] / front_df['Speed (km/h)']
815
 
816
  # Tambahkan kategori alarm status
@@ -948,7 +958,7 @@ with col4:
948
 
949
  if not rear_df.empty:
950
  # Filter kecepatan > 0 untuk hindari pembagian dengan nol
951
- rear_df = rear_df[rear_df['Speed (km/h)'] > 0]
952
  rear_df['Temp_Speed_Ratio'] = rear_df['Temperature (°C)'] / rear_df['Speed (km/h)']
953
 
954
  # Tambahkan kategori alarm status
 
320
  else:
321
  alarms = alarm_options
322
 
323
+ # Jam: Slider jam (00:00–23:00)
324
+ jam_range = st.slider(
325
+ "Jam",
326
+ min_value=0,
327
+ max_value=23,
328
+ value=(0, 23), # Default: semua jam
329
+ format="%02d:00"
330
+ )
331
+
332
  submit = st.button("Submit")
333
 
334
  # Apply filters
 
339
  if positions: dff = dff[dff['Position'].astype(int).isin(positions)]
340
  if tyre_types: dff = dff[dff['Tyre Type'].isin(tyre_types)]
341
  if alarms: dff = dff[dff['Alarm Status'].isin(alarms)]
342
+ # Tambahkan filter jam
343
+ dff = dff[dff['hour'].between(jam_range[0], jam_range[1], inclusive='both')]
344
  else:
345
  dff = df
346
 
 
347
  # ================= OBJECTIVE 1 =================
348
  # ================= OBJECTIVE 1 =================
349
  # st.markdown('<h3 class="objective-title">OBJECTIVE 1: Pressure & Temperature Trends — How Do Front and Rear Tyres Distributin?</h3>', unsafe_allow_html=True)
 
820
 
821
  if not front_df.empty:
822
  # Filter kecepatan > 0 untuk hindari pembagian dengan nol
823
+ front_df = front_df[front_df['Speed (km/h)'] > 10]
824
  front_df['Temp_Speed_Ratio'] = front_df['Temperature (°C)'] / front_df['Speed (km/h)']
825
 
826
  # Tambahkan kategori alarm status
 
958
 
959
  if not rear_df.empty:
960
  # Filter kecepatan > 0 untuk hindari pembagian dengan nol
961
+ rear_df = rear_df[rear_df['Speed (km/h)'] > 10]
962
  rear_df['Temp_Speed_Ratio'] = rear_df['Temperature (°C)'] / rear_df['Speed (km/h)']
963
 
964
  # Tambahkan kategori alarm status