Questions tagged as 'python'

3
answers

My String is giving "unicodeescape" error

I'm trying to open a file with .txt data in Python but an error message appears. arq = open('C:\Users\Cintia\Documents\Python\Dados\lbe.txt', 'r') lbe = arq.read() print(lbe) arq.close() The error is unicodeescape .     
asked by 30.10.2017 / 13:20
1
answer

Problem with values with Matplotlib in python

I have a file in csv, and I am separating the columns to display the information graphically using Matplotlib, however I have a problem when the information is empty, I change to 0 and try to display the graph again, but the result is always thi...
asked by 21.12.2018 / 16:34
1
answer

Error creating function in Python 3.7.0

I can not execute this code, it should receive an image in .BMP format and return the list of pixels, I do not know what could be wrong: from struct import pack from struct import unpack def ReadBMP(pach): image_file = open ('C:/i...
asked by 10.12.2018 / 00:14
2
answers

How to remove accent in Python? [duplicate]

In R would make this in this way iconv('Arapeí', to="ASCII//TRANSLIT") , so is there any simple way to do this in Python?     
asked by 11.12.2018 / 19:09
1
answer

Webdriver does not open browser

I've tried everything, but I can not get the code working. from selenium import webdriver driver = webdriver.Chrome() driver.get("http://www.google.com") It stops on the second line, the browser does not open. I already downloaded chromedri...
asked by 25.12.2018 / 14:00
0
answers

AttributeError: 'numpy.ndarray' object has no attribute 'pop'

I'm trying to run this code nhttps: //colab.research.google.com and gives this error. # Preprocessing function #n está funcionando :( def preprocess(data, columns_to_ignore): # Sort by descending id and delete columns for id in sorted(...
asked by 13.12.2018 / 12:20
1
answer

Problem using if and elif Python

I'm having a problem using if and elif to create an extract table by taking bank information. If the transaction category is a deposit in the bank, I want it print in a way, but after it has passed the first if , if...
asked by 13.12.2018 / 16:20
1
answer

What is the best way to do the verification? (Try-catch, multiples if, ...?)

I'm reading thousands of XML files with python. The problem is, there is not always the field in every file. resumo_cv = root.find("DADOS-GERAIS").find("RESUMO-CV").get("TEXTO-RESUMO-CV-RH") resumo_cv_ingles = root.find("DADOS-GERAIS")...
asked by 14.12.2018 / 15:14
0
answers

Ford-Fulkerson Python Algorithm

I'm doing a college job where I need to implement the Ford-Fulkerson algorithm in Python. But I'm having a hard time finding a way up in the residual graph (path function). I do not know if it is the recursion that is not working, or the for. I'...
asked by 11.12.2018 / 19:38
1
answer

Importing values from other codes into tkinter - python

Hello, I'm doing a great program and wanted to split the screens into other codes, I can already import the screens, but I need to get some values from other screens, but I can not do that. First screen: from tkinter import * import teste_i...
asked by 08.12.2018 / 16:59