Skip to content

Tag: python

How to Yeld Floats in a For Loop

I’m trying to fit a curve to some data. When I evaluate the polynomial equation with one value, I get an expected float answer. When I evaluate the polynomial equation over an array, the for loop yields integer values when the intended result is floats. I think I’m close, but I’m not sure wh…

Optimization problem for S-I-S model using python

I have a susceptible-infectious-susceptible model, to which I’ve written the following python code, And I’m solving it using the following code, This part is fine. I’m having trouble finding the double derivative and optimizing it for the value of the beta parameter. The problem is that the …

How can I set boundaries on the screen?

I’m trying to make it so that If the arrow reaches the screen boundary it will go up and turn around continuing the code so that I can create a piece of art. I’ve been looking for a post to answer my problem but I can’t find anything that’s specific to this problem. Thanks! Answer I th…

how to force python call to speedtest.py use secure servers

I’m calling speedtest.py from my python program in order to run a speed test. After importing speedtest.py I create a speedtest object using then run upload/download tests. This has been working, but recently it has been failing. I found if I just ran speedtest from the cli, I’d get a 403 forbidde…