Questions tagged as 'python'

2
answers

How can I read just one serial port message in python?

Good people, it turns out that I am communicating an Arduino UNO with a RaspberryPI and what happens to me is that when an Arduino button is pressed it sends a simple serial number to RaspberryPi and when it recives it will emit a sound, the que...
asked by 04.09.2017 / 23:06
2
answers

Validations in Class Based View ... form_valid or form_invalid

There is something I do not understand when making validations in class-based views ( CreateView , UpdateView , etc), I understand that you can do with the method form_valid and then save it with a simple form.save()...
asked by 05.09.2017 / 14:35
1
answer

Can someone explain to me the differences between HttpResponse and HttpResponseRedirect?

I'm not understanding the differences between HttpResponse and HttpResponseRedirect . Could someone explain to me?     
asked by 07.08.2017 / 01:50
1
answer

Passing order from one list to another

Good, we have a list that is ordered by a fitness already calculated called 'scored'. We are trying to 'poblacionNueva' keep the order of 'punctuated' but not show the fitness values of each element. def selection_and_reproduction(poblacionNue...
asked by 09.08.2017 / 13:43
2
answers

Excel data extraction to create Python list

I have the following excel file: connection A auto connection A camioneta connection A puerta connection B camioneta connection B puerta connection B capo and I'm looking to put together a diction in python like this: Li...
asked by 31.10.2017 / 04:45
1
answer

How do I solve this problem in the creation of a web in python?

I am trying to create a project and following the steps of a tutorial page: link , When I get to step # 4, which is Configure the VirtualHost, it tells me this: jp@JP:~/sitiopy/python-web$ sudo a2ensite python-web ERROR: Site python-web d...
asked by 13.08.2017 / 04:26
1
answer

Reindex a dataFrame on the missing columns of a second

I have two dataFrame ratings_full and side_eclipse that contain subscriber_id,eclipse_id by ratings and eclipse_id,hashtag_id by side_eclipse. Have, on the one hand, an index, and on the other hand columns of differen...
asked by 21.06.2017 / 12:09
1
answer

Group strings by date using Pandas Python

I'm working on a program, and I need to group strings that are generated on a certain date. The form of grouping that I want is to group the same chain every time it is repeated, as long as a next repetition occurs in less than 30 days. In th...
asked by 10.07.2017 / 03:21
1
answer

I can not connect to MYSQL with python

I'm using PyMySql . I just want to do a simple "Query": "SELECT * FROM python_1", I always get this error:    Traceback (most recent call last):     File "Alumnos.py", line 5, in       connection = pymysql.connect ('localhost', 'd3h', '', 'p...
asked by 09.07.2017 / 18:47
2
answers

How to create a DataFrame from an array of listings?

How to create a DataFrame from an array of non-indexed listings by indexing it over the arrays? For example [[{'count': 6L, 'item_id': 11313}, {'count': 6L, 'item_id': 11348}, {'count': 1L, 'item_id': 11338}, ],[{'count': 4L, 'item_id': 113...
asked by 10.07.2017 / 12:38