Posts by klaus • 344 points
9 posts
-
0
votes1
answer76
viewsA: How to get back the amount of an existing word within a.txt file?
I think the problem is that your second file has one word per line, and then when you search the text for that word, it looks for the word and the line break and it doesn’t find. For example, file…
-
0
votes1
answer1038
viewsA: Problem with python/ Decode
I think the problem is that the source file has no Unicode encoding. You can put this snippet right at the beginning of your file: #!/usr/bin/env python # -*- coding: utf-8 -*- Another solution is…
-
2
votes2
answers1259
viewsA: What are the function of each string prefix in Python?
In Python 2.7, you have the following options: s = 'dog': String ASCII s = u'dog': Unicode string that accepts special characters and accents (á,º,§, etc) s = r'cao n t r': String Raw, which…
-
3
votes1
answer58
viewsA: Error creating Python object
The error is here: @property def y(self): return self._x You put _x, but it’s _y.
-
0
votes1
answer60
viewsA: Ordered List Logic Error (C++)
There are several errors in your code. I fixed the function inserts and put some comments. void insere(int key) { if (tamanho < capacidade) { int i = 0; // primeiro tem que garantir que a posição…
-
1
votes1
answer28
viewsA: Cross valdation n-fold
You are not accessing the dataframe elements correctly. It is not recommended to use X[][], as the dataframe understands this as (X[])[]. In your example, you are doing X[['W1','W2']][2], which is…
-
3
votes2
answers127
views -
6
votes1
answer9357
viewsA: Run JNLP Ubuntu
I believe you need the boar sudo apt-get install icedtea-netx You can also try following some tutorial such as that…
-
1
votes2
answers195
viewsA: Find the problem in my Python object list
I also think you’re complicating the problem. I think using a Dict would be much simpler. Search Google for the Python Counter class. About your code, you are counting in the variable aux, but…