Questions tagged as 'python'

1
answer

Difference between NULL, empty and blank Python

I am making a Data Quality that receives a list with data from a Database and I have two rules: Null fields: Fields that are filled with the word NULL Blank / empty fields: Fields that come in blank or empty For the NULL rule I a...
asked by 15.05.2017 / 18:26
1
answer

Displaying certain values in Python

I need help with the following: I have a variable that generates random integers from (0 to 400). In a certain number of executions, I want the value (s) and position (s) of the lower value (s) to be 100. I have a code (see below) that I...
asked by 26.02.2017 / 18:41
1
answer

Create a list copy in Python so that they are independent

I have the following situation: I have list_1 with the following values [10,20,30,40]. I want to create a copy of this list, however I need the list_2 not to change when I modify some value in list_1. I have the following code below, bu...
asked by 04.03.2017 / 01:01
1
answer

Python Pandas: rewriting pd.read_table () with the original comments

I have a separate tab file in which the first few lines are comments designated with '#'. I use the following code to pull the file without the comments ... The file looks something like: #comentario #comentario #comentario #comentario #coment...
asked by 03.03.2017 / 14:36
1
answer

Parallel with only one core?

I'm wanting to parallelize an application, in this case a 'cosine similarity' calculation, but the machine I'm working on has only one core. Paralleling this calculation with only one core will have some significant gain?     
asked by 09.01.2018 / 13:36
3
answers

How to remove unwanted words from a text?

I'm trying to remove unwanted words from any text, but it removes other words. For example: remover_palavras = ["a", "e", "o"] The program returns: btt (potato), mns (less) What to do?     
asked by 30.06.2017 / 20:46
1
answer

How to put a class inside a JSON

Does anyone know how to put a class inside a JSON file? I need to save a class inside a JSON file, however, it returns that this file is not serializable. Does anyone know how I can put this class inside the file, and then use it? Ex: import j...
asked by 06.07.2017 / 15:30
1
answer

Import data from Mysql to Excel

I want to import data from Mysql to excel using Python, when I try to make it a tuple error. Can anyone with more experience help me? I followed the code and the error: # coding=utf-8 from Tkinter import * from os import popen import tkM...
asked by 21.09.2016 / 19:11
1
answer

Python: How to correctly import a method that depends on another?

I'm restarting a project I did in Java, trying to learn about Python in POO, but I'm stuck on something I have not found any solution to: I have 2 files ("working.py" and ".py files"). The 2nd is responsible for any services related to fil...
asked by 25.09.2016 / 21:46
1
answer

Trigger an event after two button clicks

I'm developing a small interface in Tkinter , but I have the following doubt: Is there a mouse event that allows an action to be performed after two consecutive clicks on a button?     
asked by 12.10.2016 / 01:44