forked from Jingho/Deepstack-for-Bucket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTxt_test.py
38 lines (31 loc) · 902 Bytes
/
Txt_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# -*- coding:utf-8 -*-
import settings
'''
Calculate the number of data contained in each bucket in @Cluster_result.py
'''
test = "flop"
if test == "river":
file = open("river_cluster_result_10.txt", "r")
cluster_count = settings.river_cluster_count
elif test == "turn":
file = open("turn_cluster_result40.txt", "r")
cluster_count = settings.turn_cluster_count
else:
file = open("flop_cluster_result80.txt", "r")
cluster_count = settings.flop_cluster_count
card_cluster_id = []
line = file.readline()
line = line[:-1]
id = line.split(":")[1]
card_cluster_id.append(int(id))
while line:
line = file.readline()
line = line[:-1]
if line == "":
break
id = line.split(":")[1]
card_cluster_id.append(int(id))
file.close()
print(len(card_cluster_id))
for i in range(1,cluster_count+1):
print("---- {0} th---:".format(i),card_cluster_id.count(i))