Questions tagged as 'python'

1
answer

problem with uppercase in django

I have an uppercase problem in django, in the following code, it works in the first form and in the last form, but in the intermediary forms it does not translate the letters sent to the bank in capitals ... models.py class Requerente(mod...
asked by 26.11.2017 / 00:16
1
answer

List manipulation with dictionary within a loop in Python

I have a list of lists, in which the internal lists contain words and each internal list represents the words of each different file. lista = [['carro','barco'],['moto','aviao'],['bike','skate']] ie the position lista[0] repr...
asked by 09.11.2017 / 14:59
1
answer

Find set of numbers in a list that together add X

I need to do a program where I have a list of numbers (1571.48 | 327.53 | 286.60 | 349.50 | 517.67 | 247.00 | 882.73 | 274.00 | 237.50 | 301.00 | 973.50 | 288.75 | 347.50 | 326.81), and I need to find in the middle of this list numbers that do n...
asked by 22.11.2017 / 06:49
1
answer

Python files

I have the following code: x=[] x=0.1 for i in range (101): x = 2.6868*x - 0.2462*x**3 I want to save my 'x' data to manipulate it in other software, I did the following: with open( 'saida.txt', 'w' ) as arq: for n in x:...
asked by 27.10.2017 / 18:25
1
answer

Problem instantiating classes in Python 3 [closed]

When I run my program test.py : debug returns me    object () takes no parameters '' on line 4 from tatu2 import Cliente from tatu2 import Conta joao = Cliente('João da Silva', '777-1234') maria = Cliente('Maria da Silva', '555-432...
asked by 27.10.2017 / 02:18
1
answer

How to select codes with different sizes in pandas?

In Python 3, with pandas, I have this dataframe with several codes in the columns "CPF_CNPJ_doador" and "CPF_CNPJ_doador_originario" cand_doacoes = pd.read_csv("doacoes_csv.csv",sep=';',encoding = 'latin_1', decimal = ",") cand_doacoes.info(...
asked by 21.11.2017 / 13:09
1
answer

Equivalent to the "console.dir ()" function in Python

Is there a function in the Python language (v3.6) to display attributes and methods of an object, such as console.dir() in JavaScript? I'd like to get output similar to console.dir in web browsers. The dir function of Py...
asked by 21.11.2017 / 01:11
1
answer

Django periodic checks

How could I create a loop, thread or anything that my webapp periodically checks every 5min the database and exclude entries that are "due." I researched but did not find anything specific. I even found something saying that you should create...
asked by 10.11.2017 / 21:12
1
answer

Error in running Naïve Bayes using Spark

When I change the input file (by default: sample_svm_data.txt ), on the other hand also containing numeric attributes separated by spaces, the following error occurs: File "/usr/local/spark/python/lib/pyspark.zip/pyspark/mllib/util.py", lin...
asked by 12.11.2017 / 21:38
1
answer

can only concatenate list (not "str") to list

Hello, I'm new to python and I'm probably programming with a problem that should be very conceptual. I made this code to read a numeric sequence in a txt and rename it with the string found. name_files3 = os.listdir(path_txt) for TXT in name_...
asked by 30.11.2017 / 13:45