deschamps-g commited on
Commit
dc6aa15
1 Parent(s): a414ab1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -91,7 +91,6 @@ st.plotly_chart(fig)
91
  #fig = px.histogram(data, x='checkin_type', color='state')
92
  #st.plotly_chart(fig)
93
 
94
-
95
  col = 'delay_at_checkout_in_minutes'
96
  col_mean = data[col].mean()
97
  col_std = data[col].std()
@@ -105,10 +104,14 @@ print('state: ', data['state'].value_counts())
105
 
106
  st.subheader("Retard au retour selon le mode de réservation")
107
 
 
 
 
 
 
108
  if st.checkbox('Montrer uniquement les voitures rendues en retard', value=True):
109
  mini = 0
110
  df = data[data['delay_at_checkout_in_minutes']>mini]
111
-
112
  else:
113
  df = data
114
  mini = int(df['delay_at_checkout_in_minutes'].min())
@@ -121,11 +124,10 @@ maxi = int(df['delay_at_checkout_in_minutes'].max())
121
 
122
  move_upper_mask = df['delay_at_checkout_in_minutes']<seuil
123
  lower_mask = df['delay_at_checkout_in_minutes']>mini
124
- type_mask = df['checkin_type']="mobile"
125
- global_mask = move_upper_mask & lower_mask & type_mask
126
- part_mask = move_upper_mask & type_mask
127
  number_of_rent = len(df[global_mask])
128
- part_of_rent = 100 * len(df[part_mask]) / len(df[type_mask])
129
 
130
  fig_px = px.histogram(df, color='checkin_type', x='delay_at_checkout_in_minutes')
131
  fig = go.Figure(fig_px)
 
91
  #fig = px.histogram(data, x='checkin_type', color='state')
92
  #st.plotly_chart(fig)
93
 
 
94
  col = 'delay_at_checkout_in_minutes'
95
  col_mean = data[col].mean()
96
  col_std = data[col].std()
 
104
 
105
  st.subheader("Retard au retour selon le mode de réservation")
106
 
107
+ if st.checkbox('Mobile'):
108
+ df = df[checkin_type="mobile"]
109
+ else:
110
+ df = df[checking_type="connect"]
111
+
112
  if st.checkbox('Montrer uniquement les voitures rendues en retard', value=True):
113
  mini = 0
114
  df = data[data['delay_at_checkout_in_minutes']>mini]
 
115
  else:
116
  df = data
117
  mini = int(df['delay_at_checkout_in_minutes'].min())
 
124
 
125
  move_upper_mask = df['delay_at_checkout_in_minutes']<seuil
126
  lower_mask = df['delay_at_checkout_in_minutes']>mini
127
+ global_mask = move_upper_mask & lower_mask
128
+ part_mask = move_upper_mask
 
129
  number_of_rent = len(df[global_mask])
130
+ part_of_rent = 100 * len(df[move_upper_mask]) / len(df)
131
 
132
  fig_px = px.histogram(df, color='checkin_type', x='delay_at_checkout_in_minutes')
133
  fig = go.Figure(fig_px)