Update app.py
Browse files
app.py
CHANGED
@@ -146,8 +146,9 @@ def download_boe_rates():
|
|
146 |
|
147 |
# Function to get Bank of England base rate for a given date
|
148 |
def get_boe_base_rate(date, boe_rates_df):
|
149 |
-
|
150 |
-
|
|
|
151 |
|
152 |
if __name__ == "__main__":
|
153 |
main()
|
|
|
146 |
|
147 |
# Function to get Bank of England base rate for a given date
|
148 |
def get_boe_base_rate(date, boe_rates_df):
|
149 |
+
closest_date_index = (boe_rates_df['Date Changed'] - date).abs().argsort()[0]
|
150 |
+
closest_date = boe_rates_df['Date Changed'].iloc[closest_date_index]
|
151 |
+
return boe_rates_df.loc[closest_date_index, 'Current Bank Rate']
|
152 |
|
153 |
if __name__ == "__main__":
|
154 |
main()
|