def daily_hours(data=None, to_df=False):

    send = {'data': json.dumps(data)}
    r = requests.post('http://127.0.0.1:5000/daily_hours', data=send)
    response = r.json

    if to_df:
        import pandas as pd
        concat = []
        for day, data in response.iteritems():
            concat.append(pd.DataFrame({day: data['data']}, index=data['time']))
        df = pd.concat(concat, axis=1)
        return df

    return response
Given a list of timestamps, find the number of events by hour on a daily
dataset/ETHPy150Open wrobstory/mcflyin/examples/marty.py/daily_hours