start = [35, 36, 37, 36, 35]
end = [56, 56, 56, 58, 58]
events = ['A', 'B', 'C', 'A', 'A']
df = pd.DataFrame({'start': start, 'end': end, 'events': events})
new_df = pd.DataFrame({'times': df['start'].append(df['end']), 'events': df
    ['events'].append(df['events'])})
new_df = new_df.groupby(['times', 'events']).agg(len)
new_df = new_df.reset_index().pivot('times', 'events').fillna(0)
Create new pandas timeseries dataframe from other dataframe