Need some help in getting correct comparison result for shock scenarios

I am working on a file in which i have three columns starting with scenario [+100, +25, -25, -100, Implied, EBA up, EBA Down] then rate index[GL-AUD-AONIA-01D, GL-INR-01D] then rates with next 5 year dates in monthly format.

my concern is say if for a particular rate index the implied or base shock scenario rate is say 5.00 then in case of +100 shock scenario it should be implied rate + 100 bps means 5 + 1 = 6.00 but in case the file which i am loading to pandas dataframe has a different rate say 9.00 against +100 shock scenario then it should mark it as false in comparison file which is not happening.

import pandas as pd

# Function to extract currency from rate index
def extract_currency(rate_index):
    if 'GL-' in rate_index:  # Assuming rate index starts with 'GL-'
        parts = rate_index.split('_')
        if len(parts) > 1:
            currency = parts[1]  # Extract currency after 'GL-'
        else:
            currency = None  # Handle case where currency extraction fails
    else:
        currency = None  # If rate index doesn't start with 'GL-', handle accordingly
    
    return currency

# Function to apply scenario adjustments
def apply_scenario(rate, scenario, rate_index):
    # Define shock values for each currency
    shock_values = {
        'ARS': 400, 'AUD': 350, 'BRL': 400, 'CAD': 250, 'CHF': 150, 'CNY': 300,
        'EUR': 250, 'GBP': 300, 'HKD': 200, 'IDR': 400, 'INR': 350, 'JPY': 100,
        'KRW': 250, 'MXN': 400, 'RUB': 400, 'SAR': 300, 'SEK': 300, 'SGD': 150,
        'TRY': 400, 'USD': 200, 'ZAR': 350
    }
    
    currency = extract_currency(rate_index)
    
    if currency is None:
        return rate  # Handle case where currency extraction failed
    
    shock = shock_values.get(currency, 0) / 100  # Convert bps to percentage
    
    if scenario == '+100':
        return rate + 1.0
    elif scenario == '+25':
        return rate + 0.25
    elif scenario == '-25':
        return rate - 0.25
    elif scenario == '-100':
        return rate - 1.0
    elif scenario == 'EBA up':
        return rate + shock  # Applying the shock value
    elif scenario == 'EBA down':
        return max(rate - shock, -1.0)  # Applying the shock value with a floor at -1%
    else:  # For Implied and Static scenarios
        return rate

# Load data from Excel and process
def process_excel_data(file_path, sheet_name, output_file):
    # Load data from Excel
    df = pd.read_excel(file_path, sheet_name=sheet_name, header=5)
    df = df.rename(columns={df.columns[0]: 'Scenario', df.columns[1]: 'Rate Index'})
    df['Scenario'] = df['Scenario'].str.split('/').str[1]
    
 
    rate_indexes = df['Rate Index']
    t0_rates = df.iloc[:, 2:]  # Assuming rates start from the third column
    print(t0_rates.iloc[:,:7].head())    
  
    adjusted_rates = pd.DataFrame(columns=t0_rates.columns)
   
    
    # Apply scenario adjustments and compare with T0 rates
    for index, row in df.iterrows():
        scenario = row['Scenario']
        rate_index = row['Rate Index']
        
        # Extract T0 rates for the current row
        t0_row = df.iloc[index, 2:]  # Assuming rates start from the third column
        
        # Apply scenario adjustments to T0 rates
        adjusted_row = t0_row.apply(lambda rate: apply_scenario(rate, scenario, rate_index))
       
        # Add adjusted rates to the DataFrame
        adjusted_rates = adjusted_rates.append(adjusted_row, ignore_index=True)
        
    # Compare adjusted rates with T0 rates and store the results
    comparison_results = (abs(adjusted_rates - t0_rates) < 1e-14).astype(int)
   
    # Insert Scenario and Rate Index columns to the comparison results DataFrame
    comparison_results.insert(0, 'Scenario', df['Scenario'])
    comparison_results.insert(1, 'Rate Index', df['Rate Index'])
    
    with pd.ExcelWriter(output_file, engine='openpyxl') as writer:
        comparison_results.to_excel(writer, index=False, sheet_name='Comparison Results')
        
    
    return comparison_results

# Example usage
file_path = "C:\Users\peter\Desktop\Rate_index\MF.xlsx"
sheet_name = 'Market Forecast Rate Indexes'
output_file = 'C:\Users\peter\Desktop\Rate_index\Market Forecast_comparison.xlsx'


comparison_results = process_excel_data(file_path, sheet_name,output_file)
print(f"Comparison results exported to {output_file}")

This is how the file look like

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật