QST:shape mismatch: objects cannot be broadcast to a single shape
Hi,

Im having a problem using bar chart in python is  "shape mismatch: objects cannot be broadcast to a single shape".
and the code is:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt


df=pd.read_csv('2017Jaipur_month accidents.csv')

data1=pd.DataFrame(df,columns=['acc_2017','acc_2016','Months'])
data1

index=np.arange(2,13)
bar_width=0.25


acc_2017=plt.bar(index,data1['acc_2017'],color='blue',width=0.25,label='Death in 2017')
acc_2016=plt.bar(index+0.25,data1['2016'],color='red',width=0.25, label='Death in 2016')

plt.title('2016-17 Death in Accident')
plt.xticks(index, data1.Months, rotation=90)

plt.xlabel('Time accidents')
plt.ylabel('no of accidents')
plt.show()


and the error is:
ValueError                                Traceback (most recent call last)
<ipython-input-107-3c2ff406e777> in <module>
     13 
     14 
---> 15 acc_2017=plt.bar(index,data1['acc_2017'],color='blue',width=0.25,label='Death in 2017')
     16 acc_2016=plt.bar(index+0.25,data1['2016'],color='red',width=0.25, label='Death in 2016')
     17 

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\pyplot.py in bar(x, height, width, bottom, align, data, **kwargs)
   2439     return gca().bar(
   2440         x, height, width=width, bottom=bottom, align=align,
-> 2441         **({"data": data} if data is not None else {}), **kwargs)
   2442 
   2443 

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\__init__.py in inner(ax, data, *args, **kwargs)
   1597     def inner(ax, *args, data=None, **kwargs):
   1598         if data is None:
-> 1599             return func(ax, *map(sanitize_sequence, args), **kwargs)
   1600 
   1601         bound = new_sig.bind(ax, *args, **kwargs)

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axes\_axes.py in bar(self, x, height, width, bottom, align, **kwargs)
   2372         x, height, width, y, linewidth = np.broadcast_arrays(
   2373             # Make args iterable too.
-> 2374             np.atleast_1d(x), height, width, y, linewidth)
   2375 
   2376         # Now that units have been converted, set the tick locations.

<__array_function__ internals> in broadcast_arrays(*args, **kwargs)

C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\stride_tricks.py in broadcast_arrays(*args, **kwargs)
    262     args = [np.array(_m, copy=False, subok=subok) for _m in args]
    263 
--> 264     shape = _broadcast_shape(*args)
    265 
    266     if all(array.shape == shape for array in args):

C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\stride_tricks.py in _broadcast_shape(*args)
    189     # use the old-iterator because np.nditer does not handle size 0 arrays
    190     # consistently
--> 191     b = np.broadcast(*args[:32])
    192     # unfortunately, it cannot handle 32 or more arguments directly
    193     for pos in range(32, len(args), 31):

ValueError: shape mismatch: objects cannot be broadcast to a single shape
  plz help to find out the issue.