minimize

python how to check if selenium webdriver is minimized

python how to check if selenium webdriver is minimized Question: the problem is i don’t know how to check if browser has minimized, so how to check if browser is minimized on selenium (python)? i have tried this code: driver.get_window_size() but it will return browser size before minimized, and also i have read this question …

Total answers: 1

How To Minimize Window Using Python/PySimpleGUI

How To Minimize Window Using Python/PySimpleGUI Question: Dears, How To Minimize Window Using Python/PySimpleGUI ? Knowing that , I want to hide existing title bar from my Window and add my personal icons :Maximize, Minimize and Close, it’s OK for 2 and not the case for Minimize. I followed answer shared in : How to …

Total answers: 1

Python regex to extract most recent digit preceding a keyword

Python regex to extract most recent digit preceding a keyword Question: I have a list of references in text as shown below where the texts in bold is what I want to extract using re.findall(). ’10. T. BESLEY, POLITICAL SELECTION. J. ECON. PERSPECT. 19, 43–60 (2005). 11. J. D. FEARON, CAMBRIDGE STUDIES IN THE THEORY …

Total answers: 4

scipy optimize one iteration at a time

scipy optimize one iteration at a time Question: I want to control the objective of my optimization as a function of the number of iterations. In my real problem, I have a complicated regularization term that I want to control using the iteration number. Is it possible to call a scipy optimizer one iteration at …

Total answers: 1

Restrict scipy.optimize.minimize to integer values

Restrict scipy.optimize.minimize to integer values Question: I’m using scipy.optimize.minimize to optimize a real-world problem for which the answers can only be integers. My current code looks like this: from scipy.optimize import minimize def f(x): return (481.79/(5+x[0]))+(412.04/(4+x[1]))+(365.54/(3+x[2]))+(375.88/(3+x[3]))+(379.75/(3+x[4]))+(632.92/(5+x[5]))+(127.89/(1+x[6]))+(835.71/(6+x[7]))+(200.21/(1+x[8])) def con(x): return sum(x)-7 cons = {‘type’:’eq’, ‘fun’: con} print scipy.optimize.minimize(f, [1,1,1,1,1,1,1,0,0], constraints=cons, bounds=([0,7],[0,7],[0,7],[0,7],[0,7],[0,7],[0,7],[0,7],[0,7])) This yields: x: array([ 2.91950510e-16, …

Total answers: 4

Generating a 'sequence of dicts' for scipy.optimize.minimize

Generating a 'sequence of dicts' for scipy.optimize.minimize Question: I’m using scipy.optimize.minimize with constraints. The example in the documentation ( at http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.optimize.minimize.html ) uses for constraints: cons = ({‘type’: ‘ineq’, ‘fun’: lambda x: x[0] – 2 * x[1] + 2}, {‘type’: ‘ineq’, ‘fun’: lambda x: -x[0] – 2 * x[1] + 6}, {‘type’: ‘ineq’, ‘fun’: lambda …

Total answers: 3

Minimizing a function while keeping some of the variables constant

Minimizing a function while keeping some of the variables constant Question: I have a function of the form def tmp(x,n): R, s, a, T = x[0], x[1], x[2], x[3] which returns a float, after a long block of calculations. I need to minimize this function and for that I used the scipy.optimize.minimize(): minimize(tmp,[0,0,3,60000], args=(n,),tol =1e-15) …

Total answers: 4

Structure of inputs to scipy minimize function

Structure of inputs to scipy minimize function Question: I have inherited some code that is trying to minimize a function using scipy.optimize.minimize. I am having trouble understanding some of the inputs to the fun and jac arguments The call to minimize looks something like this: result = minimize(func, jac=jac_func, args=(D_neg, D, C), method = ‘TNC’ …

Total answers: 1