Untitled

 avatar
unknown
plain_text
6 months ago
1.1 kB
5
Indexable
import pandas as pd

# Re-creating the data due to reset

# Data for Buying, Selling, and Buyback options in the Commodity Hedging Excel file
data_extended = {
    'Category': ['Initial Hedge Price', 'Buy-Back Price', 'Volume Hedged', 'Futures Buy-Back Gain/Loss', 'Options Buy-Back Gain/Loss', 'Date of Buy-Back'],
    'Input/Formula': [
        'Manually input (e.g., $5.20 per bushel)', 
        'Manually input (e.g., $5.00 per bushel)', 
        'Manually input (e.g., 10,000 bushels)', 
        'Formula: =(B3 - B4) * B2',  # Futures buy-back formula
        'Formula: =(B5 - B6 - B7) * B2',  # Options buy-back formula example
        'Manually input (e.g., 30-Sep-2024)'
    ]
}

# Creating a new DataFrame for the additional features
df_extended = pd.DataFrame(data_extended)

# Saving the updated Excel with the new features for Buy, Sell, and Buyback
file_path_extended = "/mnt/data/Commodity_Hedging_Extended_Template.xlsx"
df_extended.to_excel(file_path_extended, index=False, sheet_name="Hedging Buy-Sell-Buyback")

file_path_extended
Editor is loading...
Leave a Comment