Questions tagged as 'python'

1
answer

variable can not admit another value [closed]

n=int(input("jogadas:")) a=22695477 b=1 m=2**32 semente=3 i=1 num=None num_aleatorio = None lance_computador = None while i <= n: lance_jogador=int(input("Faça sua jogada")) if i==1: num = semente else: num = num...
asked by 02.04.2018 / 13:07
1
answer

Formatting float number in list

I have a dataframe with columns of Latitude and Longitude, in the format string Atibaia['LATITUDE'].head() 140 -231,124,852,387,647 245 -231,159,749,902,692 254 -23,116,747,205 512 -231,560,912,572,211 1348 -23,11...
asked by 30.03.2018 / 04:06
1
answer

I'm doing a test with opencv and python but the code below does not return anything ... Can someone help me by seeing if there is an error?

import numpy as np import cv2 cap = cv2.VideoCapture('peopleCounter.avi') #Open video file while(cap.isOpened()): ret, frame = cap.read() #read a frame try: cv2.imshow('Frame',frame) frame2 = frame except:...
asked by 31.03.2018 / 03:25
1
answer

Scraping data from a site with dynamic tables filtering [closed]

The platform of search of the programs conceptualized in Capes has a dynamic filtering for the own query. I would like to know how I collect the data from an output using Python. Why, using just the bs4 libs and requests I can not get output of...
asked by 06.06.2017 / 23:37
1
answer

Who runs the condition or the code block first in Python?

People have a problem and I believe it's because of the execution order I can not run such a block of code if it does not pass first for a condition if it is not going to give error, and once hear that in C it first run the code then check, is t...
asked by 19.05.2018 / 20:13
1
answer

Fill in a list

I'm in need of help, I'm developing a genetic algorithm, well my problem is that I need my loop not to stop as long as I have space on the list. As for example I have a population of 10 already created, as soon as it enters the selection functio...
asked by 18.05.2018 / 02:05
1
answer

How to compress files using python by limiting the file size by 50 mb

Good afternoon! I need help in creating a python code that reads a folder containing images, check the number of images and compress the images in packages of up to 50mb.     
asked by 12.01.2017 / 19:27
1
answer

how do I add entries from a tuple and return a tuple with an entry that has the sum of the previous d to tuple entries? add by columns

22 entries of a tuple that will have to return in a tuple the sum of each value in the corresponding column     
asked by 19.10.2015 / 23:23
1
answer

Python handle API [closed]

I want to use the following API response: link Then I want to divide it into blocks like this: [1456617600,434.3867,434.3867,433,781,433,781.4.15450000] and put it on a list to work with the data. I was doing so but it is not working:...
asked by 29.06.2017 / 20:37
1
answer

Python / Pandas - How to create in the data frame, a column "str" from another numeric, including zero to the left when the value is less than 9

The code I used to create the column is returning with the following error:    The truth value of a series is ambiguous. Use a.empty, a.bool (),   a.item (), a.any () or a.all (). I do not know how to resolve this error. import pandas a...
asked by 29.06.2017 / 14:25