Questions tagged as 'python'

1
answer

Start animation with hover event in python

I'm doing an animation of a simple frame, but I want the animation to start when the cursor is on the frame and return to its initial shape when it leaves the frame. Since at the moment it only works with one button, this is my code import...
asked by 26.06.2018 / 18:48
1
answer

Jinja2 check if a value exists in a list of dictionaries

I'm trying to check if a value exists within a dictionary list. Use flask 1.0.2. See the example below: person_list_dict = [ { "name": "John Doe", "email": "[email protected]", "rol": "admin" }, {...
asked by 07.09.2018 / 18:18
1
answer

problem in condition while "assignment operators"

Hello, I have a problem that I do not understand when using assignment operators the exercise is about printing a sum from 50 + 48 + 46 + 44 ... 20 n=50 h=0 #que hace esta variable? while n<=20: h+=n #no entiendo lo que hace esto n...
asked by 22.05.2018 / 17:58
1
answer

libvlc - python access violation reading 0x00000094

Good afternoon I am trying to generate a Python player with PyQt using the Python binding for VLC (libvlc), but it throws me the following error: This is my code: import sys from PyQt5.QtWidgets import QMainWindow, QApplication import...
asked by 18.05.2018 / 00:45
2
answers

Delete and replace values in python pandas using conditionals

I have the following Dataframe prueba = M1 M2 M3 M4 0 1 1 1 NaN 1 2 3 3 NaN 2 3 2 2 1 3 4 NaN 1 NaN 4 1 NaN NaN NaN 5 1 3 2 2 6 3 3 NaN...
asked by 20.05.2018 / 23:13
1
answer

Detect change in JSON [closed]

I put you in situation, I have an API that returns the JSON (for example link ) to which I can only access to obtain the data, I can not touch your code. I would like to know every time there is a change in the JSON (for example temp, pressu...
asked by 14.05.2018 / 08:47
1
answer

Python: 'numpy.int32' object is not iterable

I'm constantly having this error and I do not know how to fix it. This is the code: import numpy as np import itertools import random g_row=10 g_col=10 m_prob = np.ones((g_row, g_col), dtype=np.int) s_acomulada = list(itertools.accumulat...
asked by 26.05.2018 / 02:26
1
answer

Would you return an argument where you should return two in django's views?

Good afternoon dear stackoverflow friends I have this doubt, I'm trying to print pdfs from django with the xhtml2pdf library for my projects in django2.0 , I follow a tutorial that I find interesting that the source is: link My error on...
asked by 02.06.2018 / 05:23
1
answer

Change index python loop

My problem is to modify the value of k. That is, when I call the function funmeta, it returns a position that I want it to acquire k and start again the top loop for that position. As it is in the code, it is not modified. for k,i in enumerate...
asked by 07.03.2017 / 09:29
1
answer

Fill rows with missing dates in DataFrame

I am working with some data from a meteorological station in which the data is distributed by columns in day with 24 hours, predominant direction, wind direction in degrees The problem is that there are days, even full months, that do not com...
asked by 16.04.2018 / 21:25