测试环境:
hddm==0.8.0
测试文件test.csv
subj_idx,stim,rt,response,theta,dbs,conf
0,LL,1.21,1.0,0.65627512226100004,1,HC
0,WL,1.6299999999999999,1.0,-0.32788867166199998,1,LC
0,WW,1.03,1.0,-0.480284512399,1,HC
0,WL,2.77,1.0,1.9274273452399999,1,LC
0,WW,1.1399999999999999,0.0,-0.21323572605999999,1,HC
0,WL,1.1499999999999999,1.0,-0.43620365940099998,1,LC
0,LL,2.0,1.0,-0.27447891439400002,1,HC
0,WL,1.04,0.0,0.66695707371400004,1,LC
0,WW,0.85699999999999998,1.0,0.11861689909799999,1,HC
测试代码:test.py
import pandas as pd
import matplotlib.pyplot as plt
import hddm
#https://hddm.readthedocs.io/en/latest/tutorial_basic_hddm.html
data = hddm.load_csv('./test.csv')
data = hddm.utils.flip_errors(data)
fig = plt.figure()
ax = fig.add_subplot(111, xlabel='RT', ylabel='count', title='RT distributions')
for i, subj_data in data.groupby('subj_idx'):
subj_data.rt.hist(bins=20, histtype='step', ax=ax)
plt.savefig('hddm_demo_fig_00.pdf')
结果: