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
Category: Questions
How to remowe a string up to a specific character (Python/pandas)?
I have the DataFrame: How I can cut values that get the next result, which you can see in the df[‘name_2] column: enter image description here Answer You can use urllib.parse module to parse those URLs.
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
Appending Dataframe to another dataframe with first row removed
Right now this query creates 14 csv files. What I wanted is, the for loop to remove the first row of column headers and append the data to a dataframe I created outside the for loop. so that I can get it as single csv file. I am using BS and Pandas. Answer This is one way of achieving your
Certificates won’t work in Python requests
I am trying to create a little Python script to send data to a server using the requests module in Python. To make it a bit more secure i want to use self signed certificates made in a program called XCA. When using the certificates in the browser everything works and is secure. When using Postman to send a request
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
How to filter subcategories of rows from one column, based on counts in second column
Sorry it’s a bit complicated, but lets say I have a very long table of IDs and Fruits: ID Fruit 1 Apple 2 Banana 4 Orange … … 3 Banana 1 Orange The ID may be repeated several times in the table and the fruit may also be repeat several times. For example, in the whole dataframe, ID #1 can
Pandas: Remove rows in a group if a particular value is also in a group
I’m trying to use groupby and agg() function for this data processing step: Input: I plan to aggregate the data by ID. The requirement is if apples and oranges show up for the same ID, keep ‘Apples’; for other combinations, keep the first observation for each ID. So wanted output: I could pivot the table and use np.where; however, in