I’m getting a strange result when squaring -1 in idle. What’s going on? Unexpected result: Expected result: Answer Operator precedence (the – is a unary minus operator):
Tag: exponential
How to find the maximum x value of a function?
I need to find the maximum x value associated to the maximum y value of the following function that I plot using Python matplotlib module: Hence, the trend is this one: If I use the max() function in such way: It prints only the maximum y value (that in this case is equal to 0.8306243772229114). How can I do to
How to use scipy.optimize.fmin with a vector instead of a scalar
When using Scipy’s fmin function, I keep encountering the error message: ValueError: setting an array element with a sequence I have seen that this question has been asked already some times, and I have read interesting posts such as: ValueError: setting an array element with a sequence Scipy optimize fmin ValueError: setting an array element with a sequence Scipy minimize
Subset-AVG – Finding a subset of List Which Matches Known Rational Number
I’ve asked this on math overflow and used comments to clarify/overstate my question. I hope it has the intended effect and doesn’t come off as jarring. I’m attempting to find what subset of numbers reach a known average. I have a list of known values, negative and possible decimals. They look something like this {-.32,-.64,-.12,.08,-.54,-.43, …} It’s around 50 numbers