回答編集履歴
1
修正
test
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
f = [12.51057368788498, 11.817749828118718, 14.58359647000698, 12.627675716457086, 14.569902607773328, 12.21944622313139, 12.627675716457086, 14.58359647000798, 12.627675716457086, 14.58359647000698, 11.817749828118718, 14.58359647000698, 12.51057368788498, 14.569902607773328, 12.21944622313139, 14.58359647000798, 14.58359647000698, 12.627675716457086]
|
6
6
|
|
7
7
|
unq, cnt = np.unique(f, return_counts=True)
|
8
|
-
out = np.repeat(unq, cnt//2)
|
8
|
+
out = np.repeat(unq, (cnt+1)//2)
|
9
9
|
|
10
10
|
print(out)
|
11
11
|
# [11.81774983 12.21944622 12.51057369 12.62767572 12.62767572 14.56990261
|