Commit 6a47cd9a29f22efeab8cdb0f0dda6346a7acb07f

Authored by Cristina Muntean
1 parent d6474f3a

test val

Showing 1 changed file with 5 additions and 6 deletions   Show diff stats
prepare_plot_scatter_2_distrib.py
... ... @@ -47,7 +47,6 @@ def readFromFileMultipleEdges(filename, columnNumber):
47 47 :param columnNumber:
48 48 :return:
49 49 '''
50   - max_in_distrib = 0
51 50 docList = list()
52 51 f = codecs.open(filename, "r", "utf-8")
53 52 first_line = f.readline()
... ... @@ -58,10 +57,10 @@ def readFromFileMultipleEdges(filename, columnNumber):
58 57  
59 58 # read first line to get max
60 59 word = rowDataCols[1]
61   - counter = rowDataCols[columnNumber-1] # the index starts at 0 so column 9 corresponds to 8 in the array index
  60 + counter = int(rowDataCols[columnNumber-1]) # the index starts at 0 so column 9 corresponds to 8 in the array index
62 61 print type(counter), counter
63   - docList.append(tuple([word, int(counter)]))
64   - max_in_distrib = int(counter)
  62 + docList.append(tuple([word, counter]))
  63 + max_in_distrib = counter
65 64 print type(max_in_distrib), max_in_distrib
66 65  
67 66 # read other lines
... ... @@ -69,8 +68,8 @@ def readFromFileMultipleEdges(filename, columnNumber):
69 68 if len(line.split("\t")) == numCols:
70 69 rowDataCols = line.replace("\n", "").split("\t")
71 70 word = rowDataCols[1]
72   - counter = rowDataCols[columnNumber - 1]
73   - docList.append(tuple([word, int(counter)]))
  71 + counter = int(rowDataCols[columnNumber - 1])
  72 + docList.append(tuple([word, counter]))
74 73 if counter > max_in_distrib:
75 74 max_in_distrib = counter
76 75 return docList, max_in_distrib
... ...