[Python] efficient frontier plotting in python

Discussão em 'Python' iniciado por Stack, Março 3, 2025.

  1. Stack

    Stack Membro Participativo

    I am working on efficient frontier optimization, the objective function is maximizing volatility where my output is dataframe of returns and risks respectively, I plotted it I got the bullet shaped curve but I want to connect those points as well how to do that ?risk return tradeoff

    import plotly.express as px
    import pandas as pd

    # Sort the data by 'Volatility' to ensure a smooth curve
    data = data.sort_values(by="Volatility")

    # Create an interactive line plot
    fig = px.scatter(data, x="Volatility", y="Returns",
    title="Efficient Frontier (Risk-Return Tradeoff)")

    # Show the figure
    fig.show()

    Continue reading...

Compartilhe esta Página