I am trying to plot the graph bellow using python, but I am getting an error.
The Python commands I am using are:
import pandas as pd
import matplotlib.pyplot as plt
data = pd.read_csv('data/filtro_bovespa_final.csv')
data.loc[(data['codigo'] == 'BBAS3') & (data['codigo'] == 'BBDC4')]
data.date = pd.to_datetime(data['date'],format='%Y%m%d')
data.set_index(['date','codigo'])
plt.plot(data.date,data.preco)
plt.show()
The error I am getting is:
I got this graph, but it is not what I need:
The csv file I am using: Bovespa
I need a graph that allows me to compare the price linked with both the codes (BBAS3 and BBDC4) as the first graph I showed.
What else should I do to get the graph I need?



data.plotanddata.show. Do you meanplt.show()?data.show, what happens if I comment out?