Please forgive me if this is not the place to ask this question. I’m running python scripts in a Jenkins pipeline from a Jenkinsfile. I am also updating Jira Xray tickets within the Jenkisfile. Behave is being used to validate the test status. If the check fails then the Jenkins build fails without gett…
Tag: python
Verify that a column name is a unique identifier
I have a dataset called df_authors and in that dataset I have a column called author. I have to verify that df_authors.author is a unique identifier. What I tried, len(df_authors) == len(df_authors[‘author’].unique()), and this returns True. My question is have I done this right. I found this line…
random number generating function as argument in python
I want to pass a function which generates random normal numbers to another function, do some calculations and pass again the random function x times. At the end there should be a Dataframe with x colums with diffrent randomly generated outcomes. My code looks like this: But this gives me always identical colu…
How to format very small numbers in python?
How to format 1.3435434533e-8 into 1.34e-8 in python? Keep only two digits. The round() method will round this number to zero. Answer The “g” formatting suffix on string mini-format language, used both by f-strings, and the .format method will do that:
Remove specific string char at the beginning of each lines of a txt file using python
I’m currently working on a script in python. I want to convert an xls file into a txt file but I also want to clean and manage the data. In the xls files, there’s 4 columns which does interest me. Here is a sample of the txt I get from the conversion : To get this result I used this
Systemd consumer service starts before broker (RabbitMQ )
I have a RabbitMQ server set up on my raspberry Pi and I want the same device to run a consumer to handle messages to one of my queues. I first tried executing it from the crontab but realized later that running it as a systemd service may be a better idea. This is my first time setting up a
How to create a for loop with checking appended models
I have a list of models that I iterate through in a for loop getting their performances. I’ve added catboost to my model list, but when I try to add it’s best estimator to a dictionary it gives me an error no other models give me (TypeError: unhashable type: ‘CatBoostRegressor’). Googl…
TensorFlow: How do I generate a dataset from two arrays?
I’ve been trying to generate a custom dataset from two arrays. One with the shape (128,128,6) (satellite data with 6 channels), and the other with the shape (128,128,1) (binary mask). I have been using the function tf.data.Dataset.from_tensor_slices: What I get is this: However, when I try to run this t…
How to add aliases to an input dictionary?
Recently I started a project. My goal was it to have a script, which, once launched, could be able to control actions on the hosts computer if an instruction was send via email. (I wanted this so I could start tasks which take a long time to complete while I’m away from home) I started programming and n…
Is there any way to detect edge in this situation?
I try to detect edge using python. There are hundreds of algorithms for edge detection, however, the image is very obscure and unclear. The most serious problem is one edge is located at the local maximum value, but the other edge is located slightly shifted from local maximum value. Through the detailed exam…