Skip to content
Advertisement

Category: Questions

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 am i missing? Answer From the error message, it appears the constraint stream use one version of Shift, and the domain model use a DIFFERENT version of Shift. Do not redefine

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 can check if a

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.take_along_axis: Output:

Parameters are ignored in python web request for JSON data

I try to read JSON-formatted data from the following public URL: http://ws-old.parlament.ch/factions?format=json. Unfortunately, I was not able to convert the response to JSON as I always get the HTML-formatted content back from my request. Somehow the request seems to completely ignore the parameters for JSON formatting passed with the URL: Does somebody know how I am able to get the

How could I use and manipulate float numbers in PyPanel using textbox widgets instead of sliders?

The Problem: I’m trying to get a float number user input indicator box like this which I designed on LabView in Python using PyPanel to eventually make a dashboard with multiple similar boxes (etc.). Background: I’m trying to make a user friendly dashboard using PyPanel. I am new to dashboards but have some experience in running calculations and modelling in

Advertisement