Questions tagged as 'python'

1
answer

Relationship Django Models

I have a model named Item and I made a call Compra . I have been able to relate several items to each purchase, but I do not know how to relate the quantity of each item to each purchase. class Item(models.Model): nome = models....
asked by 09.11.2018 / 13:27
1
answer

"[-4:]" What is this syntax?

I have the following expression: namer = name[-4:] Where name gets a name, but what does this [-4:] mean?     
asked by 05.11.2015 / 23:01
1
answer

TypeError: list indices must be integers or slices, not str

Hello everyone. When I run this code I get the following return: TypeError: list indices must be integers or slices, not str How can I fix this? import pagarme import psycopg2 pagarme.authentication_key("API_KEY") transaction = pagarme...
asked by 30.10.2018 / 22:55
0
answers

Bag of words in Python

I have a news dataset and want to separate them between two classes. For this I thought of using Bag of words, but I'm not getting with Sklearn. I've tried the following: #Bag of words from sklearn.feature_extraction.text import CountVectorize...
asked by 31.10.2018 / 02:01
1
answer

Problems with python libraries, ChatBot

I'm having problems in the Python library, specifically ChatBot, the error is as follows: from chatterbot import Chatbot ImportError: cannot import name 'Chatbot' " Here is my code: from chatterbot import Chatbot import pyttsx import spee...
asked by 29.10.2018 / 20:04
1
answer

No module named - Python

Hello, I installed mailchimp3 this way: pip install mailchimp3 And also the mailchimp: pip install mailchimp There was no error. When I'm going to run the podium in python: from mailchimp3 import MailChimp client = MailChimp('YOU...
asked by 29.10.2018 / 20:53
1
answer

Odoo V11 - Overwrite information from a given field in the database

I am making a filter to find the id of a record, and from there to update certain fields ... I am able to locate the records but I can not overwrite the information. if validar_voo: logger.info("Entrei aki") log...
asked by 26.10.2018 / 22:50
0
answers

How to do quicksort "manual"

I have already done a SelectionSort manual in Pyhon see below: lista = [] # digite 0 para encerrar a entrada de dados while True: x = input('Entrada: ') if x == '0': break else: lista.append(x) nota = [] for x in lista: nota.append(0...
asked by 26.10.2018 / 20:33
1
answer

Peak value of a histogram

My code reads an image and transforms the RGB color model into HSV, and then makes a frequency histogram of each channel (H, S, and V), where H varies from 0-179 and the others 0-255. By plotting the histogram, it is possible to check peaks in H...
asked by 01.11.2018 / 18:18
1
answer

How to pass data from one input to another with HTML and Python?

Well, I have a problem with my application and I can not find the solution on the internet. I'm doing a web application where I need to get some information from the user and to improve the experience, I'm separating the form into several pag...
asked by 28.10.2018 / 21:18