Questions tagged as 'python-3.x'

1
answer

Django forms.CheckboxSelectMultiple issues: Select a valid choice. [''] is not one of the choices available

I'm trying to use a checkbox to select items in a list, but it returns the following error: Select a valid choice. [''] is not one of the available choices. app models.py : from django.db import models from django import forms from djan...
asked by 31.08.2018 / 19:49
1
answer

How do I always when the Down key is pressed and win +10? (Python3 + Tkinter)

from tkinter import * from tkinter import messagebox jan = Tk() jan.geometry("500x500") Quadrado = Frame(jan,bg="#B0C4DE", width=25, height=25, bd=3, relief="raise") Quadrado.place(x=50, y=50) def moveUp(event): print("Key Up") jan.bi...
asked by 06.09.2018 / 03:28
1
answer

Question about object orientation in Python

I'm a roommate we were doing a script I wrote my script in this way: detalhes = programa.duracao if hasattr(programa, 'duracao') else programa.temporada In my case, I'm calling it that! My friend in this way below, I was in doubt as to the...
asked by 20.09.2018 / 14:25
3
answers

Python - Select 2 columns of a DF and classify them

I'm new to the programming world, and I'm doing some studies to gain knowledge in the area of Data Science. Come on ... I have a Dataframe with a lot of information, among it gender and age. I want to bring the amount of lines of each gender...
asked by 21.08.2018 / 16:16
1
answer

Error executing script in Python3 (with Symfony / Process) on a Laravel Controller

I'm trying to run a Python3 script I've developed, which is located in a folder inside Laravel's app folder. One of the script is called by a Controller and the other by an Artisan Command. public static function searchAnswers($input) {...
asked by 18.09.2018 / 14:48
2
answers

How to inherit a pygame class?

When I run this code (this is the current integer code, ie only 3 lines): import pygame class sp(pygame.sprite): pass I get:    TypeError: module () takes at most 2 arguments (3 given) I would like to inherit this class to create...
asked by 17.09.2018 / 03:42
1
answer

How to delete a table row in sqlite3?

I am trying to make a crud in sqlite3 with a GUI through tkinter my table was created in DB Browser for sqlite. I have developed a little but it is not working: from tkinter import * from tkinter import ttk import sqlite3 #db_name = 'bancoda...
asked by 31.08.2018 / 01:58
1
answer

Select values from a column from other columns

I'm trying to select only the values from the flightID column where DepDelay and ArrDelay I tried this: delay = data.loc[(data['ArrDelay'] > 15) & (data['DepDelay'] > 15), ['FlightID']] But it did not work ... KeyError...
asked by 09.10.2018 / 17:33
1
answer

Django + Postgresql object has no attribute

I'm trying to do a validation before sending my form, however it returns me the following error: 'StudentForm' object has no termAccepted attribute app models.py: from django.db import models from django import forms from django.forms...
asked by 28.08.2018 / 21:07
1
answer

How to change the color of a curve when the values increase?

I have a dataset. Sometimes some values increase compared to previous ones. resultsCos = [(0, 0.4235497237569061), (0.005, 0.4235497237569061), (0.01, 0.4238950276243094), (0.015, 0.42382596685082874), (0.02, 0.42375690607734806), (0.025, 0.42...
asked by 27.08.2018 / 18:58