what is the beste way to implement this Travelling salesman Problem ? I got...
You are given a set of instances of the (symmetric) Travelling Salesman problem downloadable on Moodle. Each instance is a text file (with the format described below)giving you a number of “cities” n...
View ArticleStuck on Django 4.2.11
I try to learn Django but I came across a wall.I need to use Django 5 for my project but when I update Django to 5.0.3 my terminal update it than say that I am still in 4.2.11.So I tried to uninstall...
View ArticlePandas: Merge two datasets with different names
I'm trying to merge datasets A and BThey have similar names but not exactly the same. I want to find the name in dataset B that best matches one in dataset A.ex:name on A: candy, hard, blue...
View ArticleAnsible-lint Custom Rule Matching with Regex
I want to use Ansible-lint to check to see if subnets are formatted correctly in my yaml files.right: 10.10.10.0/32Wrong: 10.10.10.0 /32I created a custom rule: from ansiblelint import AnsibleLintRule...
View ArticleDevelop Volatility Stop (Average True Range Trailing Stop) Indicator in Python
I recently started learning Python and trying to develop "Volatility Stop" indicator in Python from Trading View Pine Script.Following is Trading View Pine Script.//@version=5indicator("Volatility...
View Articlehow to get continuous date index base on the first index values on Pandas
I got an df with this index, at some point the date change from 2024-03-03 to 2023-02-25.I want to replace the wrong part (2023...) by the logical extend of the correct onesample:2024-02-23...
View ArticleException when attempting to create Namespaced Pod - Bad Request
I'm working with Airflow DAG and Kubernetes for the first time.I have a Python script that connects to AWS S3 and reads some files. This works fine if I run it in a Docker container/image using bash....
View ArticleReturned list of tuples from openai isn't recognized by python
I am trying to generate a list of tuples from openai's API which seemed to work fine at first and the output also looks good when I print it out. Still python doesn't recognize it as a list of tuples...
View ArticleHow to make discord bot give me a role
I created my own discord bot and it has all permissions on the server. I need a Python script to make it give me a role, but I don't really know how.
View Article"RuntimeError: Make sure the Graphviz executables are on your system's path"...
I downloaded Graphviz 2.38 MSI version and installed under folder C:\Python34, then I run pip install Graphviz, everything went well. In system's path I added C:\Python34\bin. When I tried to run a...
View ArticleOpen XML document protection implementation (documentProtection class)
I'm trying to implement the Open XML documentProtection hash protection of a MS Word (2019) document in Python to test the hashing algorithm. So I've created a Word document, protected it against...
View ArticleControl real-time animations from a menubar but only the page in the foreground
I am working with matplotlib and tkinter in Raspberry pi 4B. I have three different sensor readings shown in real-time. My goal is to pick a sensor from the menubar, which would open the corresponding...
View ArticleHow to iterate a list created with SeqIO using re.findall, FASTA-input
I have spent way too much time on this now (+10 hours).Input is a file in fasta-format.Output should be a text-file containing the gene-ID and the matched patterns (three different patterns)I wanted to...
View ArticleHow do I link xbbg to B-Pipe (Bloomberg)
Hi I'm currently using xbbg with no issues, but the Bloomberg API limits my personal license to 500k api hits per day. I'm getting B-Pipe access soon which should alleviate the limit but I'm unsure how...
View ArticleDo I need to create a cronstuctor in Model Flask Sqlalchemy?
I'm creating some models in Flask SqlAlchemy, but I have a dobt about it. Do I need to create a constructo init or I can make without it?I can do like this?:class User(UserMixin, db.Model):...
View ArticleBug with y axis minor ticks
Minor ticks on the y-axis are not placed as they should be. I set the minor locator to 2 so there should be 1 minor tick between each major tick but ticks on the bottom of the y-axis and none at the...
View ArticleConvert Row values into Column values using Python Pandas DataFrame
Convert concatenate column and row values and assigned to New column after groupby one column in the dataframe.The below code trying to convert the expected results however it taking longer time to run...
View ArticleDefine a polymorph Marshmallow schema in Python
Consider we have the UserSchema which contains two attributes of name and user. The issue is that I am looking for a solution to load AdminSchema or GuestSchema based on the type attribute of...
View ArticleError install mediapipe windows 11 with python 3.12
Message:ERROR: Could not find a version that satisfies the requirement mediapipe==0.10.11 (from versions: none)ERROR: No matching distribution found for mediapipe==0.10.11Python 3.12Visual codeInstall...
View ArticleFast way to convert 2d string numpy array to a 3d int array
I have a very large numpy array with entries like:[['0/1''2/0']['3/0''1/4']]I want to convert it/ get an array with the 3d array like[[[0 1] [2 0]][[3 0] [1 4]]]The array is very wide, so a lot of...
View Article