import pandas as pd

# Cumulative entries and exits for one station for a few hours.
entries_and_exits = pd.DataFrame({
    'ENTRIESn': [3144312, 3144335, 3144353, 3144424, 3144594,
                 3144808, 3144895, 3144905, 3144941, 3145094],
    'EXITSn': [1088151, 1088159, 1088177, 1088231, 1088275,
               1088317, 1088328, 1088331, 1088420, 1088753]
})

def get_hourly_entries_and_exits(data):
    '''
    takes a DataFrame with cumulative entries
    and exits, returns a DataFrame with hourly entries and exits.
    '''

    return (data - data.shift(periods=1)).drop(0)

print get_hourly_entries_and_exits(entries_and_exits)
