0

I have this code

def ch1(div, pares): for j in zip(div,pares): dtm=pares[j] etiqueta=div[j]

    fig = go.Figure(data=[go.Candlestick(x=dfm['Date'],
                        open=dfm['Open'],
                        high=dfm['High'],
                        low=dfm['Low'],
                        close=dfm['Price'])])


    fig.update_layout(
        title= etiqueta,
    )

    fig.show()

1 Answers1

0

A possible solution can be found here: How to iterate through two lists in parallel?

Your code should look like something similar to this:

def ch1(div, pares):
    for m_div, m_pares in zip(div, pares):
        dtm=m_pares
        etiqueta=m_div                

        fig = go.Figure(data=[go.Candlestick(x=dfm['Date'],
                            open=dfm['Open'],
                            high=dfm['High'],
                            low=dfm['Low'],
                            close=dfm['Price'])])


        fig.update_layout(
            title= etiqueta,
        )

        fig.show()

ch1(div, pares)
AnsFourtyTwo
  • 2,480
  • 2
  • 13
  • 33