Category "python"

exe converted from python in pyinstaller crashes

My main.py executed well in PyCharm import cv2 from cvzone.PoseModule import PoseDetector import json if bboxInfo: with open("tempCapFile.txt", 'w')

Crop a polygon shape from an image without libraries except numpy

I have a list of points let's say 5 points. I want to crop the area that this polygon is covering from the image. Here, red areas are the points and I want to c

How can I plot a line chart with two different companies monthly sales from 12 months before and 12 months after

The dataframe is a snapshot of what I'm working with. What I want to achieve is a line chart of the monthly sales of the different brands. Months with '-' befor

Get only those rows from a pandas data frame where a particular value is not present in a data frame column of type list

One of my columns in dataframe is of type list. I want to get only those rows where color is not red.Output should give row 2 and 3. I tried def Removecolo

Calculating remaining CIDR ranges with Python

I need assistance in calculating in Python the remaining CIDR ranges after i use a subnet. Example: I want to use a wide range of 10.0.0.0/15 and from it to cal

How to Print celery worker details on windows and mac

I actually had issues printing mine on command prompt because I was using the wrong command but I found a link to a project which I forked Project (If on Mac )

Python Websocket wait for variable change

I have a class that contains a websocket-client WebSocketApp, that is started in a thread. The websocket connection recieves messages and sets some class variab

Adding to a value in a loop counter in Python

I’m trying to get it add 1 to streak every time the loop runs, but it keeps the same number. I’m trying to make a counter every time it sees red. fr

Images disappears from django web app deployed to heroku

I am working on a django project, writing rest APIs with django rest framework to use them in android application, my main idea is develop back end in django an

Type hint for an exhaustive dictionary with Enum/Literal keys

I'm working on code bases with extensive type hints, checked by mypy. There's several instances where we have a mapping from an enum.Enum or other small finite

Cannot add dependencies for sub packages in CDK V2 in Python

CDK v1 to v2 migration guide suggests adding requirements as below: aws-cdk-lib>=2.0.0 constructs>=10.0.0 aws-cdk.aws-codestar-alpha>=2.0.0alpha1 ...

Windows10 failed to install python-lib :crfnet from github using "python setup.py build_ext"

I want to install a python-lib named crfnet which is a deep-learning library whose environment is: Windows10 CUDA11.1 Tensorflow2.4.4 keras2.4.4. I have install

can i make my scraping (pandas read html) script faster?

i have a very simple script, it just scrapes some tables off the internet and inserts it into a db. however: tickerlist contains about 8000 rows. and the script

Selecting a subset of a dataframe based on a list - pandas

I am working with a large dataframe (ftp://ftp.ncbi.nlm.nih.gov/genomes/refseq/bacteria/assembly_summary.txt) with pandas in Python 3, using PyCharm. The column

Python & Selenium: How to get values generated by JavaScript

I use Selenium in Python for scraping. I can't get values though these values are displayed on the browser. So I checked the HTML source code, then I found that

How to use onnxruntime parallel with flask?

Created a server that want to run a session of onnxruntime parallel. First question, will be used multi-threads or multi-processings? Try to use multi-threads,

Fit data to integral using quad - magnetic hysteresis loop

I'm having trouble getting a fit to converge, as it's either not converging or giving a NaN error, depending on my start parameters. I'm using quad to integrate

iterate over a df and multiply the values by the values of another df

My df1 looks like this:It contains 3 unique project id.The date starts on 01-01-22 and ends on 01-12-28 id date p50 p90 apv1 01-01-22 1000 1000 apv2 01-01-22 1

networkx find_negative_cycle parameters

What am I supposed to pass as the source parameter to the find_negative_cycle() method of the python networkx module? In the documentation it says to pass a lis

How to convert XML Files into Text files (YOLOV3 Format) for object detection

How we convert XML annotation folder into text or YOLOv3 Format for detection??? I used this code for conversion but it only take one xml image and convert into