application_vnd.jupyter.stderr_output_1.png
data = pd.read_csv('../input/DSL-StrongPasswordData.csv', header=0)
data = data.reset_index()

hold_cols = [x for x in data.columns if x.startswith('H.')]
switch_cols = [x for x in data.columns if x.startswith('UD.')]
timing_cols = [x for x in data.columns if x.startswith('H.') or x.startswith('UD.')]
def get_subject_data(*subjects, include_subject=False):
    """ Returns the timing information for each trial of the given user
        The delays alternate between key hold time and delay to the next key
    """
    cols = timing_cols + (['subject'] if include_subject else [])
    return data.ix[data.subject.isin(subjects), cols]
s24 = get_subject_data('s002', 's004', include_subject=True)

def plot_comparison(*subjects):
    data = get_subject_data(*subjects, include_subject=True)
    fig = plt.figure(figsize=(12, 12))
    for i, delay in enumerate(timing_cols):
        ax = fig.add_subplot(5, 5, i + 1)
        for u in subjects:
            _ = data.ix[data.subject == u].hist(delay, ax=ax, alpha=0.75, label=u)
    return fig
_ = plot_comparison('s052', 's036', 's002')