Dear Huaiming,
From the “[“ at the beginning of your output, I think that your magnetization variable is a list of DataSet objects. (maybe a list with only one entry) This is quite common in pyalps, since most functions operate on list of datasets, and return list of datasets.
To access the data the following should work: magnetization[0].x magnetization[0].y
Regards, Michele
-- ETH Zurich Michele Dolfi Institute for Theoretical Physics HIT G 32.4 Wolfgang-Pauli-Str. 27 8093 Zurich Switzerland
dolfim@phys.ethz.ch www.itp.phys.ethz.ch
+41 44 633 78 56 phone +41 44 633 11 15 fax
On 26 Sep 2015, at 08:05, Huaiming Guo hmguo@buaa.edu.cn wrote:
Dear All, I have a question about the dataset class. Suppose I have a variable “magnetization” in class dataset (see below). I prefer the data form as the following, X(1), y(1) X(2), y(2)…. I want to know how I use the x of magnetization. I tried magnetization.x or magnetization.y, but it does not give me results. Many thanks for the reply.
Sincerely, Huaiming
class DataSet(ResultProperties):
magnetization [x=[ 0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1. 1.2 1.4 1.6 1.8 2. 2.2 2.4 2.5] y=[0.000125981483652 +/- 0.000122322506977 0.00860528601563 +/- 0.000365690783567 0.0222620599739 +/- 0.00089047889358 0.0370211267606 +/- 0.000570927849528 0.048406793936 +/- 0.000429342486559 0.0584663763909 +/- 0.0004796634673 0.0728869134363 +/- 0.000659369158556 0.0893286949981 +/- 0.000587776900735 0.101889483066 +/- 0.000593519471563 0.1160502693 +/- 0.000825142408233 0.133805849632 +/- 0.00057575130612 0.165816585036 +/- 0.000469748080503 0.208087821355 +/- 0.000521162407847 0.258726150393 +/- 0.000553055778572 0.331226556639 +/- 0.000601625820527 0.434736729908 +/- 0.000675053120055 0.491099090239 +/- 0.0003387686197 0.499313131313 +/- 8.51581569713e-05 0.499728317659 +/- 5.31002968192e-05] props={'observable': 'Magnetization Density', 'local_S': 0.5, 'THERMALIZATION': 100.0, 'J': 1.0, 'SWEEPS': 100.0, 'L': 20.0, 'LATTICE': 'chain lattice', 'hdf5_p ath': '/simulation/results/Magnetization Density', 'xlabel': 'h', 'T': 0.08, 'yl abel': 'Magnetization Density', 'MODEL': 'spin', 'label': ''}]