Questions tagged as 'python-3.x'

1
answer

(Pandas) - Group and summarize by date

Hello, I am a beginner in pandas and I have a problem that I did not find / understood how to solve in the documentation or other topics. Briefly I need to group the days of my database observations within five days, and for each interval calcul...
asked by 21.08.2018 / 05:34
1
answer

Django: Reverse for '' not found. '' is not a valid view function or pattern name

I'm trying to put a url based on my views.py but it returns me the error: Reverse for 'create_student' not found. 'create_student' is not a valid view function or pattern name. project urls.py: from django.contrib import admin...
asked by 20.08.2018 / 21:43
1
answer

Error with syntax in Python 3.7

I'm practicing a course exercise and came across the following error below. I am using Python 3.7. What is the problem with this typing? convite = 'Flavio Henrique Almeida' parte1 = convite[0:4] parte2 = convite[11:15] print "%s %s" % (parte1,...
asked by 02.09.2018 / 18:40
1
answer

How to display accents in python?

I need to read a file of names in python, but they are full of accents, I'm using this to open arquivo = open('dadostxt/Nomes.txt', 'r', encoding='utf-8') I put utf-8 in the encoding, but when I go to excel or give a print, instead of the a...
asked by 30.05.2018 / 00:38
1
answer

Receiving Nan (not a number) while reading a .CSV file with numpy

Using python 3.6.5 import numpy as np valores = np.genfromtxt("arquivo.csv",delimiter = ";",skip_header = 1) print(valores) .csv file: Valores1,Valores2,Valores3 10,20,30 40,50,60 70,80,90 34,54,23 Output: array([nan, nan, nan, nan]...
asked by 30.04.2018 / 01:20
1
answer

Find substring with REGEX

I'm trying to turn all N parts (...) into uppercase. I thought REGEX would be the most appropriate. But it is very difficult, nor capture the part N (...) to later convert it in capital letters I can: My file:    muffled, muffled.A + H_PRE...
asked by 30.05.2018 / 16:24
1
answer

content management in python

try: with open('valores.bin', 'r+b') as arq: n = struct.unpack('i', arq.read(4))[0] arq.seek(0) for i in range(n): arq.seek(0) if isinstance(struct.unpack('i', arq.read(4)), int) and struct.unp...
asked by 30.04.2018 / 05:32
2
answers

Logic to get the lowest read value of the user

What's wrong with my logic? I can not return the smallest value def menor(size): size = size vet = [0] * size menor = 0 for i in range(size): vet[i] = int(input('Digite os valores: ')) if vet[i] > menor:...
asked by 26.03.2018 / 03:39
1
answer

importing a file containing a function that I wrote: does not see global variable

ConstroiMatriz.py file: """ Escreva uma função que recebe um inteiro m e outro n e com isso constrói uma matriz mxn """ matrix = [] def main(): m = int(input("Digite o número de linhas da matriz: ")) n = int(input("Digite o número de...
asked by 26.03.2018 / 01:06
1
answer

Program to pick up a webpage events

source code here too: link Goal: catch events in% with% Each month, the URL changes only the thin, for example, in April will be: http://www.bhaktiyogapura.com/2018/03/calendario-vaisnava-abril-2018/ As I can not get right on the pa...
asked by 29.03.2018 / 19:26