Questions tagged as 'python-3.x'

1
answer

Why does this strange result appear when printing the values defined in the class? (Python)

Well, I created this class (Car class), then set the values for each argument of that class. But when printing the variable with the already defined values, this appears: #isso é o que aparece ao imprimir a variável car1 <Car object at 0x7f...
asked by 08.10.2017 / 18:08
1
answer

Return from file reading function in python

I made this code snippet to loop through the contents of the list files. lista_nome_base_docs = ['a.txt', 'b.txt', 'c.txt'] tamanho = len(lista_nome_base_docs) print (tamanho) lista_geral_arquivos = [] for i in range(tamanho): with ope...
asked by 06.10.2017 / 15:53
2
answers

Data analysis with list in python

I have a list in txt with the following data: lista.txt AC;12;733559;8476515;11.57 AL;27;3120494;24574808;7.87 AM;13;3483985;59779292;17.17 AP;16;669526;8265965;12.36 BA;29;14016906;154340458;11.01 CE;23;8452381;77865415;9.22 DF;53;257016...
asked by 22.06.2018 / 05:23
2
answers

How to install Opencv

I would like to know how to install the latest version of Opencv 3.2 on Linux ubuntu 14.04. I was able to install and put to compile in codeblocks using C ++ following a tutorial. But my goal is to actually install the opencv library so that I u...
asked by 15.07.2017 / 22:16
1
answer

Check if a key exists in a dictionary

How can I check if a key exists inside a dictionary in Python?     
asked by 18.07.2017 / 01:15
1
answer

Slice proportional to the size of the dataframe

How can I make a slice in the dataframe according to its line size? For example: if the dataframe has 14 rows, split into 2 rows of 7, if you have 28 rows, divide into 3 rows of 7, and so on. Is there any function of the pandas to do this?...
asked by 05.07.2017 / 20:16
1
answer

Logarithmic Scale Chart with Python

Initially I created a chart of Values X time (time in Unix Time) with the following code: # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import matplotlib.dates as dates from datetime import datetime, timedelta x = [] y = [] with op...
asked by 22.09.2017 / 17:14
1
answer

TypeError: can not multiply sequence by non-int of type 'float'

I'm learning to program in python , but I came across an error while trying to build merge sort using object orientation. When calling the sort() method that belongs to the MergeSort class, the following error is displ...
asked by 30.06.2017 / 17:15
1
answer

Get and Set using PROPERTY - Python3

As a property learning object, I created a small currency converter. See: class converteMoeda(): def __init__(self, dollar=0, real=0): self.dollar = dollar self.real = real def toDollar(self): dollar = self.real/self.dolla...
asked by 28.06.2017 / 16:44
1
answer

Problems with the While repetition structure

I'm trying to create a program based on the% rewrite structure, but the loop does not end. sexo = str(input('Digite seu sexo:')) if sexo != 'M' or sexo != 'F': while sexo != 'M' or sexo != 'F': sex = str(input('Digite seu sexo:'))...
asked by 21.11.2017 / 18:08