Skip to content

Tag: python

Optapy error at “solver_manager_create(solver_config)”

I am trying to run solver_manager_create method as it shown in the quick start code in optapy repo (https://github.com/optapy/optapy-quickstarts/blob/04fd102ee31919cacc4145d0517fe07b2627ca02/employee-scheduling/services.py#L168) But i am receiving a java.lang.IllegalArgumentException error. Full Error: what a…

Python, string in format of setting variables into variables

This is probably very simple, but I can’t seem to find an answer anywhere. I have a String: How do I turn this into the three different variables? This is in python 3. Answer As the structure of your string looks simple, you can use the split method with several delimiters (using the re package). You ca…

Can I sort two related arrays in parallel using python?

I have two NumPy arrays with the shape (74395, 1) storing float values where arr1[0] correlates to arr2[0] and so on. I would like to sort them together in ascending order by the values stored in the second array. As an example: wanted result: How could I do that in python? Answer Use numpy.argsort with numpy…