I am trying to create subplots for two different pandas series. I want there to be two bar plots next to each other. The data has been normalized so the plots would share a y-axis but there are different values in the x-axis between plots. See below for an example of what I've tried.
df1 = pd.Series(data = [.49, .37, .25, .11, .05], index=[['stop a', 'stop b', 'stop c', 'stop d', 'stop e']])
df2 = pd.Series(data = [.65, .32, .19, .10, .01], index=[['stop a', 'stop b', 'stop d', 'stop f', 'stop h']])
fig, axes = plt.subplots(nrows=1, ncols=2, sharey=True)
df1.plot(kind='bar', ax=axes[0,0])
df2.plot(kind='bar', ax=axes[0,1])
The code returns the following error.
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed
How can I create the two subplots to visualize the data?
