Questions tagged as 'python'

2
answers

group tuples of a list [closed]

I am interested in grouping tuples of two elements of a list of tuples that share an element. How could I do this in python? For example, if I have the list [(1,2),(2,5),(3,4),(4,1),(8,2)] the answer should be [[(1,2),(2,5),(8,2)],[...
asked by 28.11.2018 / 16:26
2
answers

Python 3 handling error TypeError: catching classes that do not inherit from BaseException is not allowed

When I run this code: i=0 while i<5: i=i+1; try: SellSta=client.get_order(symbol=Symb,orderId=SellOrderNum,recvWindow=Delay) except client.get_order as e: print ("This is an error message!{}".format(i)) #End whil...
asked by 24.11.2018 / 04:35
1
answer

Doubt in an exercise with While condition

Hi, I've been doing exercises with the While condition, but I still have trouble understanding how the exercise works. It consists of entering 10 notes and saying the notes over 7 and under, I have guided myself with other exercises and I have m...
asked by 22.04.2018 / 15:00
1
answer

Variables in global python 3

In a cash register program, I have defined the variable "price" as global in a function. In another function I read it and it works well, but at the time of modifying it, it tells me that the variable is referenced before the assignment. How do...
asked by 30.03.2018 / 20:32
1
answer

Disable chrome window in selenium python

I need to deactivate the browser window that opens when the tests are run. I copy the code I use and it should work but it does not: from selenium.webdriver.chrome.options import Options class LoginTest(unittest.TestCase): def test(self):...
asked by 20.02.2018 / 21:41
1
answer

keypressevent does not detect the enter key pyqt

A simple question I am trying to detect the enter key of my keyboard by pressing it but it does not work. this is the code I use: import sys from PyQt5.QtWidgets import QMainWindow, QApplication from PyQt5 import QtCore from PyQt5 import Qt...
asked by 21.03.2018 / 01:51
1
answer

GroupBy Data Validation

It is necessary to group the items by name Then we must see that all those with the same names also coincide in RREF1, RREF2, RREF3 and if they are not the same in the RREF that says which. # Agrupacion por valores similares en column...
asked by 09.04.2018 / 22:39
3
answers

How to access global variables in python

I have been developing this project for some time, I only had it in a single file and when I modularized it I had problems compiling the type "global name 'file' is not defined", where file is a global variable. I have a file "main" which is the...
asked by 11.04.2018 / 08:10
1
answer

Integer numbers in pandas python "dataframe"

I import a document to jupiter and enter normal with whole numbers, I apply a formula to group, add and then subtract and the product leaves all the numbers with decimals and exponentials. How do I get only whole numbers ??? ::::::: attach...
asked by 12.04.2018 / 00:25
1
answer

Error installing clarifai could not find a version that satisfies the requirement clarifai.rest (from versions :)

I'm trying to install a module called clarifai, using pip install clarifai, and it throws me the following error    could not find a version that satisfies the requirement clarifai.rest   (from versions:) from what I have read others have...
asked by 11.04.2018 / 14:21