mattritchey commited on
Commit
657cbfc
1 Parent(s): b18117b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -64,7 +64,7 @@ def geocode(address):
64
  #Side Bar
65
  address = st.sidebar.text_input(
66
  "Address", "Dallas, TX")
67
- date = st.sidebar.date_input("Loss Date", pd.Timestamp(2021, 7, 14), key='date')
68
  df_hail=get_data()
69
 
70
 
@@ -83,7 +83,7 @@ df_hail_cut['Miles to Hail'] = [
83
  df_hail_cut['MAXSIZE'] = df_hail_cut['MAXSIZE'].round(2)
84
 
85
  df_hail_cut=df_hail_cut.query("`Miles to Hail`<10")
86
- df_hail_cut['Category']=np.where(df_hail_cut['Miles to Hail']<.1,"At Location",
87
  np.where(df_hail_cut['Miles to Hail']<1,"Within 1 Mile",
88
  np.where(df_hail_cut['Miles to Hail']<3,"Within 3 Miles",
89
  np.where(df_hail_cut['Miles to Hail']<10,"Within 10 Miles",'Other'))))
@@ -103,10 +103,11 @@ for c in missing_cols:
103
  df_hail_cut_group2=df_hail_cut_group[cols_focus]
104
 
105
  for i in range(3):
106
- df_hail_cut_group2[cols_focus[i+1]]=np.where(df_hail_cut_group2[cols_focus[i+1]]<
107
- df_hail_cut_group2[cols_focus[i]],
108
- df_hail_cut_group2[cols_focus[i]],
109
- df_hail_cut_group2[cols_focus[i+1]])
 
110
 
111
 
112
  df_hail_cut_group2=df_hail_cut_group2.sort_index(ascending=False)
 
64
  #Side Bar
65
  address = st.sidebar.text_input(
66
  "Address", "Dallas, TX")
67
+ date = st.sidebar.date_input("Loss Date", pd.Timestamp(2023, 7, 14), key='date')
68
  df_hail=get_data()
69
 
70
 
 
83
  df_hail_cut['MAXSIZE'] = df_hail_cut['MAXSIZE'].round(2)
84
 
85
  df_hail_cut=df_hail_cut.query("`Miles to Hail`<10")
86
+ df_hail_cut['Category']=np.where(df_hail_cut['Miles to Hail']<.25,"At Location",
87
  np.where(df_hail_cut['Miles to Hail']<1,"Within 1 Mile",
88
  np.where(df_hail_cut['Miles to Hail']<3,"Within 3 Miles",
89
  np.where(df_hail_cut['Miles to Hail']<10,"Within 10 Miles",'Other'))))
 
103
  df_hail_cut_group2=df_hail_cut_group[cols_focus]
104
 
105
  for i in range(3):
106
+ df_hail_cut_group2[cols_focus[i+1]] = np.where(df_hail_cut_group2[cols_focus[i+1]].fillna(0) <
107
+ df_hail_cut_group2[cols_focus[i]].fillna(0),
108
+ df_hail_cut_group2[cols_focus[i]],
109
+ df_hail_cut_group2[cols_focus[i+1]])
110
+
111
 
112
 
113
  df_hail_cut_group2=df_hail_cut_group2.sort_index(ascending=False)