34 |
clazz = Classification() |
clazz = Classification() |
35 |
|
|
36 |
i = 0 |
i = 0 |
37 |
|
maxValue = float(len(_list) - 1) |
38 |
for value in _list: |
for value in _list: |
39 |
prop = ramp.GetProperties(float(i) / len(_list)) |
prop = ramp.GetProperties(i / maxValue) |
40 |
clazz.AppendGroup(ClassGroupSingleton(value, prop)) |
clazz.AppendGroup(ClassGroupSingleton(value, prop)) |
41 |
i += 1 |
i += 1 |
42 |
|
|
57 |
cur_min = min |
cur_min = min |
58 |
|
|
59 |
end = "[" |
end = "[" |
60 |
|
maxValue = float(numGroups - 1) |
61 |
for i in range(1, numGroups + 1): |
for i in range(1, numGroups + 1): |
62 |
|
|
63 |
prop = ramp.GetProperties(float(i-1) / numGroups) |
prop = ramp.GetProperties(float(i-1) / maxValue) |
64 |
|
|
65 |
if intStep: |
if intStep: |
66 |
cur_max = min + int(round((i * (max - min + 1)) / float(numGroups))) |
cur_max = min + int(round((i * (max - min + 1)) / maxValue)) |
67 |
else: |
else: |
68 |
cur_max = min + (i * (max - min)) / float(numGroups) |
cur_max = min + (i * (max - min)) / maxValue |
69 |
|
|
70 |
if i == numGroups: |
if i == numGroups: |
71 |
cur_max = max |
cur_max = max |
76 |
else: |
else: |
77 |
_range = Range(("[", cur_min, cur_max, end)) |
_range = Range(("[", cur_min, cur_max, end)) |
78 |
|
|
79 |
clazz.AppendGroup(ClassGroupRange(_range, None, prop)) |
clazz.AppendGroup(ClassGroupRange(_range, prop)) |
80 |
|
|
81 |
cur_min = cur_max |
cur_min = cur_max |
82 |
|
|
124 |
i = 1 |
i = 1 |
125 |
end = "]" |
end = "]" |
126 |
|
|
127 |
|
maxValue = float(numGroups - 1) |
128 |
for (q, p) in quantiles[3]: |
for (q, p) in quantiles[3]: |
129 |
|
|
130 |
prop = ramp.GetProperties(float(i-1) / numGroups) |
prop = ramp.GetProperties(float(i-1) / maxValue) |
131 |
|
|
132 |
if i == numGroups: |
if i == numGroups: |
133 |
max = endMax |
max = endMax |
135 |
else: |
else: |
136 |
max = _list[q] |
max = _list[q] |
137 |
|
|
138 |
group = ClassGroupRange(Range((start, min, max, end)), |
group = ClassGroupRange(Range((start, min, max, end)), prop) |
|
None, prop) |
|
139 |
|
|
140 |
group.SetLabel("%s%% - %s%%" % (round(oldp*100, 2), |
group.SetLabel("%s%% - %s%%" % (round(oldp*100, 2), |
141 |
round(p*100, 2))) |
round(p*100, 2))) |
188 |
i = 1 |
i = 1 |
189 |
end = "]" |
end = "]" |
190 |
|
|
191 |
|
maxValue = float(numGroups - 1) |
192 |
for (q, p) in quantiles[3][1:]: |
for (q, p) in quantiles[3][1:]: |
193 |
prop = ramp.GetProperties(float(i) / numGroups) |
prop = ramp.GetProperties(float(i-1) / maxValue) |
194 |
|
|
195 |
if i == numGroups: |
if i == numGroups: |
196 |
max = endMax |
max = endMax |
198 |
else: |
else: |
199 |
max = _list[q] |
max = _list[q] |
200 |
|
|
201 |
group = ClassGroupRange(Range((start, min, max, end)), |
group = ClassGroupRange(Range((start, min, max, end)), prop) |
|
None, prop) |
|
202 |
|
|
203 |
group.SetLabel("%s%% - %s%%" % (round(oldp*100, 2), |
group.SetLabel("%s%% - %s%%" % (round(oldp*100, 2), |
204 |
round(p*100, 2))) |
round(p*100, 2))) |