Я запустил код Python, и вот полный код следующим образом:
import MDAnalysis as mda
import matplotlib.pyplot as plt
%matplotlib inline
u = mda.Universe('nptmd.tpr','nptmd.xtc')
H = u.select_atoms('byres(name OW HW1 HW2)')
A = u.select_atoms('byres(name OW HW1 HW2)')
D = u.select_atoms('byres(name OW HW1 HW2)')
hb_ac = hbonds.HydrogenBondAutoCorrel(u, acceptors=A, hydrogens=H, donors=D,bond_type='continuous',sample_time=5,nruns=20000,nsamples=10,pbc=True,angle_crit=130.0, dist_crit=3.0)
hb_ac.run()
hb_ac.solve()
time = hb_ac.solution['time']
results = hb_ac.solution['results']
tau = hb_ac.solution['tau']
fit=hb_ac.solution['fit']
estimate = hb_ac.solution['estimate']
print("{time} {results}".format(time=time,results=results))
print("{time} {estimate}".format(time=time,estimate=estimate))
plt.figure(1,figsize=(15, 5))
plt.figure(1,figsize=(15, 5))
plt.subplot(122)
plt.xlabel('time')
plt.ylabel('HBLc')
plt.title('HBL Continuos')
plt.plot(time,results, 'ro')
plt.plot(time,estimate)
plt.show()
print (tau)
Результаты, которые я получаю как: -
[0. 0.5 1. 1.5 2. 2.5 3. 3.5 4.] [1.0000000e+00 5.2790266e-01 3.2588491e-01 2.1265593e-01 1.4223534e-01 9.6894175e-02 6.6584438e-02 4.6033673e-02 3.1977266e-02]
Но я хочу получить результаты как:
0. 1.0000000e+00
0.5 5.2790266e-01
1. 3.2588491e-01
1.5 2.1265593e-01
2. 1.4223534e-01
2.5 9.6894175e-02
3. 6.6584438e-02
3.5 4.6033673e-02
4. 3.1977266e-02
Как я могу получить вывод, как указано выше ..?
Любые предложения высоко ценятся.