Questions tagged as 'python-3.x'

1
answer

Copy part of the Dataframe where column is Null or NaN

I have the following question. I have the following sample dataframe: import pandas as pd df = pd.DataFrame({'A' : [4,5,13,18], 'B' : [10,np.nan,np.nan,40], 'C' : [np.nan,50,25,np.nan], 'D' : [-30,-50,10,16], 'E' : [-40,-50,7,12]}) Df...
asked by 22.11.2018 / 20:13
1
answer

setting an array element with a sequence

I have a program in python and opencv that reads an image and then checks the colors of the image in each position of two% nested%. Since I am doing for in the image to make it easier to verify, it will return a binary image. And I can no...
asked by 05.01.2019 / 19:25
1
answer

Complex operations with Python (pygame.math.Vector2)

I'm learning Python and came across a complex expression that derives from pygame.Vector2 : import pygame x = pygame.math.Vector2(1,2) b = x * 5 - (1, 2) print(x) print(b) Result: [1, 2] [4, 8] In the above case, the same x *...
asked by 29.09.2018 / 03:13
1
answer

with transformation [closed]

def eR(k,x): if k<=1: return 1 else: return (x**k)/eR(k-1,x)*k x=int(input("Insira o X:")) k=int(input("Insira o número de termos:")) print(eR(k,x))     
asked by 28.09.2018 / 21:47
1
answer

Problem in A \ u015bvagho \ u1e63a (Python3) encoding?

I'm working with wikipedia, and I'm having some coding problems. When I add such a link in my browser everything works fine: link That goes for the article with the following name: link That's the same article but the url is bein...
asked by 14.09.2018 / 19:38
1
answer

How do I make a button draw something new on a screen with tkinter?

I tried to make a data simulator in Python with Tkinter that shows the layout of the die in the window after rolling. For this, I defined a function that generates a random number from 1 to 6 and draws the data side on a screen depending on the...
asked by 31.08.2018 / 02:37
1
answer

how do I put a Scrollbar in a window in python as if it were a web page, the more content I could get down through Scrollbar

I wanted to get into the program window using tkinter, it would be possible to use a Scrollbar to look for more items in the window so that it does not have its limited height, so you can drag the scrollbar down (Vertical Only) to find more item...
asked by 08.08.2018 / 11:31
1
answer

multiple commands with python subprocess

I'm developing a system (college work) that consists of a website for the use of a particular board. The problem is that to run the code on the card, I need to execute a lot of commands. Currently my code looks like this: def run(): com...
asked by 04.07.2018 / 20:46
1
answer

ValueError in KFold of Scikit-learn: my dataset has two classes! What is going on?

I tried cross-validating a logistic regression using Scikit-learn . Here is the code: kf = KFold(n_splits=5, random_state=None, shuffle=False) kf.get_n_splits(previsores) for train_index, test_index in kf.split(previsores):...
asked by 10.10.2018 / 17:52
3
answers

How do I in python to at the end of the code, it go to the beginning again

How do I in python to end the code, does it go to the start again and repeat once every 3600 seconds? My code: * fb = Facebook ( "meu-token" ) fb.testing = False try: start_time = time.time() markov.collecttext("./markov")...
asked by 14.10.2018 / 12:59