Questions tagged as 'python'

1
answer

Install mysql-python on Windows

What steps should I follow to correctly install mysql-python on my Windows operating system?     
asked by 11.02.2016 / 21:49
1
answer

How to generate a json of an object that comes from forms.ModelForm

Hi, I would like to create and save an object in the database which has arguments args and kwargs . the arguments args and kwargs must obey the format JSON , I have the following: class ProgramarActividadForm(f...
asked by 20.01.2016 / 14:28
1
answer

Python hollow figures

I just need to know how I could turn these two figures (triangle and rhombus) into hollow figures, that is, only show their edges. my code is this: def Rombo(n): l = [[' ' for x in range(n)] for z in range(n/2+1)] for e in range(n):...
asked by 24.12.2018 / 05:18
0
answers

Error Tor AssertionError: Not supported proxy scheme socks5h

I was making a request with tor import requests proxies = {"http":"socks5h://locahost:9050","https":"socks5h://localhost:9050"} r = requests.get("http://httpbin.org/ip",proxies=proxies).content print r When executed, the error appears As...
asked by 30.12.2018 / 00:16
0
answers

Problems loading CSS styles in Django project

I have started to maintain a site already built and I have been asked to add a carousel. I have integrated a model: class Event(models.Model): tag = models.CharField(max_length=100, verbose_name="Tag") title = models.CharField(max_len...
asked by 26.11.2018 / 03:44
1
answer

Sort list according to the value of the last two digits is repeated or not

It is possible to sort in python a list like this: lista = ["0113", "0208", "0312", "0430", "0512", "0612", "0716", "0827", "0916"] So, taking into account the last two digits of each element, compare them and group them if they have the sa...
asked by 21.10.2018 / 21:13
1
answer

Sort treeview columns

I have a thread in which I asked how to generate a treeview from a panda dataframe in python. The thread is this: How to use Tkinter ProgressBar My problem now is that I do not know how to implement a function that orders each column whe...
asked by 13.09.2018 / 11:29
0
answers

Python code error (line 4) [closed]

I have a syntax error in line 4 of the code, in the print. Help please. a=float(input('Introduzca una nota del 0 al 10: ') if 0<=a>5 print('Suspendido') elif 5<=a>8 print('Aprobado') elif 8<=a>9.5 print('Notable')...
asked by 28.09.2018 / 18:12
0
answers

Naive Bayes Python Probability error

I have a question, and that is that I have 2 dataset, one is AdultTest and another AdultData. In those dataset you have many rows of this type: 39, State-gov, 77516, Bachelors, 13, Never-married, Adm-clerical, Not-in-family, White, Female ,...
asked by 29.08.2018 / 14:40
1
answer

DataFrame cleanup

I have a dataframe where there is an index and several columns, in the columns there are empty rows (my idea is not to eliminate them, but to fill them, since I do not want to lose so much data) I know a lot of the information of that column (wi...
asked by 29.08.2018 / 15:52