Questions tagged as 'python'

1
answer

Problem when creating Dataframe in Pandas using Python 3.x

I have several lists and I want to create only one Dataframe to export later. The lists are of the type: a=[1, 2, 3, 4, 5, 6, 7, 8] b=[9, 10, 11, 12, 13, 14, 15, 16] For this I am creating 2 dataframes in the following way:...
asked by 09.08.2017 / 00:31
1
answer

Black video capture with openCv

According to a tutorial this code helps me to capture video, also pass it in gray scale. However, when I run it, the video display comes out in black and also the video that is saved has almost no weight (4kb). Could someone give me a hand...
asked by 24.07.2017 / 16:56
2
answers

Is there a way to allow the user to navigate through a directory to select a file?

Basically, what I want to achieve is that the user can select a file interactively (as in the "browse" windows)     
asked by 30.07.2017 / 02:46
2
answers

Dictionary encoded Python

I need to convert A to B. I work with Python 2.7 A: payload = {"trafficChannel":{"name":"tuviaasa","status":0,"billedEvent":"ai","env":"desktop","dealType":"fixed_price","optimizeAllAdSources":"false","optimizeFor":"ecpm","publisher":"5a031...
asked by 08.11.2017 / 21:21
2
answers

Managing an ImageField in Django - Rendering it in an html template

I have a custom user model in which I want to add a user avatar field: class User(AbstractBaseUser, PermissionsMixin): # email # username # first_name # last_name slug = models.SlugField(max_length=100,blank=True)...
asked by 13.06.2017 / 17:41
2
answers

How to nest splits in Python?

Following this question , I began to think, that it is a fairly common pattern, to interpret a string with "pairs" of values separated by some character, and how to solve it in Python ?. Let's see the example: We have this string: texto =...
asked by 07.09.2017 / 19:09
1
answer

Bar detector in python with anaconda

I'm creating a bar detector in Python with Anaconda, but I get this error: Error Imagen No imagen I can not show my frame. Can someone help me? Here the code: import Tkinter import cv from Tkinter import * from PIL import Image, ImageT...
asked by 16.06.2017 / 05:38
1
answer

How to add arrays of tuples in Python with respect to index?

I want to add two arrays, follow_dismiss and display of differente size that comes from SQL queries that have a value and an index on the index that comes from an sql query: cur.execute("""-- nombre de fois ou l'utilisateur fait...
asked by 22.05.2017 / 16:39
1
answer

Error pressing QPushButton

Dear I have a small application in pyqt5 and QT DESIGNER. The application works well only when you run the "clean" button the application stops working. I leave the code to see if someone can help me where the error is generated....
asked by 23.12.2017 / 02:08
1
answer

Iterate a list in Django

I have a model called Precompra and from there I am interested in the price to calculate the total for now. What is the problem with this code that is not showing me the result in the template. This code was programmed in view.py...
asked by 13.04.2017 / 17:48