I have a dataframe which looks like:

```
       date
1      2008-10-05
10     2007-03-30
100    2008-07-05
1000   2007-03-30
1001   2014-08-14
1002   2007-09-30
1003   2007-06-14
1004   2006-01-13
1005   2006-08-04
1006   2007-06-14
1007   2008-11-30

```

What I want to do is plot a histogram which shows the dates distribution scaled down to a week. 
For example,
The index is say a picture ID, I want to drill down to visualize how many pictures were taken in the first week of October of year 2006. I want a weekly histogram in other words. 

`df['week'].iplot(kind='histogram')` only gives back the week number but I want to tie it back to the year. 

It would be great if someone could help me to plot the histogram using plot.ly. A matplotlib plot will also do. 

Thanks for your help.

Edit: Below is the final solution to my problem:

```
df_new = df.groupby(['year','week']).count()['date']
df_dict = df_new.to_dict()
df_tups = [(' wk#'.join(map(str,key)), df_dict[key]) for key in df_dict.keys()]
df_tups = sorted(df_tups, key=lambda x : (x[0], x[1]))
x = ["'"+tup[0][2:] for tup in df_tups]
y = [tup[1] for tup in df_tups]
trace1 = go.Bar(
            x = x,
            y = y
        )

data = [trace1]
layout = go.Layout(
    xaxis=dict(tickangle=45)
)
fig = dict(data=data, layout=layout)
py.iplot(fig)

```