Quote by Leslie Lamport:
Coding is to programming like typing is to writing
My generalization: IMHO, developers often start coding (i.e. typing) way too early.
I am a full-time consultant and provide services related to the design, implementation and deployment of mathematical programming, optimization and data-science applications. I also teach courses and workshops. Usually I cannot blog about projects I am doing, but there are many technical notes I'd like to share. Not in the least so I have an easy way to search and find them again myself. You can reach me at erwin@amsterdamoptimization.com.
Quote by Leslie Lamport:
Coding is to programming like typing is to writing
My generalization: IMHO, developers often start coding (i.e. typing) way too early.
I needed to find a ranking of a large data set. Using Python, it makes sense to look at the numpy library for this.
Numpy has the function argsort, which returns index positions [1]. One would think these are exactly the ranks we are after. Unfortunately, this is not the case.
>>> import numpy as np >>> a = [3.0, 1.0, 5.0, 2.0] >>> indx = np.argsort(a) >>> indx array([1, 3, 0, 2], dtype=int64)
On sudoku.com[1] there is now an "evil" difficulty level. I found these very difficult to solve by hand (I usually give up).
cfm = quicksum( max(quicksum(cf[i][t] * q[i] - L[t] for i in range(I)), 0) for t in range(T) / quicksum(L[t] for t in range(T)) <= 0.015