Category "python"

How to parse this custom log file in Python3

The log file is generated by a program written in C++. Here is the demo log: |Frame:0|NUMBER:0 |Frame:1|NUMBER:1|{INDEX:0|RECT:[11,24][31,43]} |Frame:2|NUMBER:2

Remove Key = NaN within loop for Specific Column

I created a dictionary from a dataframe using a loop. The key are ID's but some ID's are NaN from source. How can I drop rows in the loop where the ID column (w

How can I draw a circle next to each other with a text in center uisng opencv in python?

I'm trying to draw a concurrent circles of equal radius on top row of image with a text on center of circle. I'm able to draw a single circle on center of imag

RecursionError: maximum recursion depth exceeded in comparison : Recursive function

i dont understand why am getting this max depth error . iam trying to find index of number in array using bst recursive approach , below is my code # Binary Sea

Order of Layers in Folium

I am working on creating a map where I am using weather data, as well as overlaying images to show where things are. My problem is that the ImageOverlay raster

understanding try except python/django

I need your help with understanding try-except python/Django. so I have this function: def submit_dept_head_application(request, application_id): cv = request.F

How do I implement pyshacl inference in module?

How do I implement the examples in SHACL Advanced Features using pyshacl in Python Module so I can get the inferred result?

How do I create a DNS response packet

I have tried this, first is the dns request packet. The second packet is recognized also as a dns request packet. I want the second packet to be a dns response

Reading command output with Paramiko invoke_shell/send/recv never finishes

I am trying to use send/recv function in Paramiko. According to what I see, the line throws an exception of timeout Evaluating: self.shell.recv(1024) did not f

How to save my first dataframe value with Pandas?

I just don't get it. I'm trying to save two different value(to different position) to an excel file, but the first one gets overwritten everytime. Why? @classme

Get the rudder rotation angle of the robot's compass

there is an electronic compass with angles of 1-360 degrees (or 0-359, whatever) https://i.stack.imgur.com/Q7RmH.jpg there are variables Yaw - compass readings

Python 3.7: xgboost.core.XGBoostError

I am new to Python and Iam getting this error when running xgBoost: xgboost.core.XGBoostError: [15:49:05] C:/Users/Administrator/workspace/xgboost-win64_release

Image segementation dataset format

I'm following this tutorial: Tensorflow Image Segmentation I want to make my own dataset. Ideally, following the same format as the Oxford pet dataset used in

Import command fails when repository is used as a submodule

Sorry, I know it's a overasked topic but I'm pretty new to these stuff and didn't understand. I have a repository with the following structure: repo_name/

Set description for query parameter in swagger doc using Pydantic model (FastAPI)

This is continue to this question. I have added a model to get query params to pydantic model class QueryParams(BaseModel): x: str = Field(description="quer

Slack notification from lambda not breaking message in newline

I am using below code to send message to slack from aws lambda, need to have newline between first and second variable. Both of them are of string type. Message

translate an image after rotation without using library

I try to rotate an image clockwise 45 degree and translate the image -50,-50. Rotation process works fine:(I refer to this page:How do I rotate an image manuall

Python - obtaining the sum of digits of cube numbers

I want to write a code in python to print The sum of the digits of all whole cube numbers in a range that received from the user. for example if he chose [1,100

get number of accounts or number of miners via web3.py

I'm using the Web3.py library to pull Ethereum data about transactions, blocks, etc. I would like to either pull the number of Ethereum accounts or number of mi

Drawing median and quartile lines on an Altair violin plot

Suppose I had the following plot (taken from the tutorial in the Altair documentation): import altair as alt from vega_datasets import data alt.Chart(data.cars