Below are the pivot dataframes df1 and df2. Now I am trying to make subplots in plotly by using below dataframes. But I am getting key error while executing my code. My code as under:
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
pio.renderers.default='browser'
df1 = Student July August
Bobby 824 516
df2 = Country July August
EUR 274 150
USA 212 128
China 113 170
Port 44 10
# plotly setup for fig
fig = make_subplots(2,1)
fig.add_trace(go.Bar(x=df1.Student, y=df1.loc['July','August']),row=1, col=1)
fig.add_trace(go.Bar(x=df2.Country, y=df2.loc['July','August']),row=2, col=1)
fig.show()