Category "python"

How to deploy an existing Python package to JFrog local Artifactory?

I am using local Artifactory, no remote. For in-house Python package deployment, I used python setup.py bdist_wheel upload -r local, it works. I have installed

How to detect the colors nicely using OpenCV python

(It is not the whole code, it's just the main part) It's just a simple project I wanted to do, not school or anything. I want to segment out the red parts nicel

Convert string to int before querying django ORM

I have a model class Entry(models.Model): maca = models.CharField(max_length=100, blank=True, null=True) This field will accept only numbers (cannot set ch

How to calculate Breathing rate from Recorded Audio file (Digital Signal)?

I have one recorded Breathing rate audio file (Digital Signal). So i want to remove noise from the file and calculate Breathing rate value using Python language

Boto3 import not found by SageMaker inference endpoint

I have a PyTorch model deployed on SageMaker, having an inference endpoint. Its configuration is serverless. The structure of the tar.gz model package is as fol

How to insert DEFAULT value with MySQLdb string formatting?

I have run into this a few times now, where I'm trying to insert (or bulk insert) into a MySQL table using VALUES without defining the columns explicitly, but t

how to extract the text from the exec() of function in python

I want to use exec() function to execute a child script inside the main script. but I wanted to do so with other strings in combination but since the exec() com

Is there a way to create a custom dictionary in python

Hello I was wondering if there was an existing version of an idea I had where you can create a custom dictionary like so: MyCustomDict = {'value':'values':'valu

use python with TDengine database but got bind params error

It's quite simple to insert data into TDengine database but still got errors. use conn.statement("insert info cache_record values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?,

else cant read the variable "msg"

so basically I have some code that will look at a Reddit page and get the title, link, current upvotes, and how long ago it was posted. And if the links aren't

Want input given in 1st class to be accessed by other class

I am very new to python so please ik the code is not so professional and stuff class VMReader: def __init__(self, filename): filename = input("pleas

local variable 'allLibrary' referenced before assignment

I can't seen to understand what the issue here is, I am getting an error that local variable 'allLibrary' referenced before assignment, Please help @app.route('

logistic regression; how to find the actual value of predicution (e.g. 3.5, 2.6). Due to model set up, y-pred is iether 1 or 3

I am currently coding a logistic regression. Here is my set up. X values - X-train/X-test based on count vectoriser. Y values - either 1/3 (boolean values for n

How to process files in FastAPI from multiple clients without saving the files to disk

I am using FastAPI to create an API that receives small audio files from a mobile app. In this API I do processing of the signal and I am able to return a respo

Scrapy only scraping and crawling HTML and TXT

For learning purposes, I've been trying to recursively crawl and scrape all URLs on https://triniate.com/images/, but it seems that Scrapy only wants to crawl a

AWS Aurora: bulk upsert of records using pre-formed SQL Statements

Is there a way of doing a batch insert/update of records into AWS Aurora using "pre-formed" Postgresql statements, using Python? My scenario: I have an AWS lamb

How to read a .log file in Python

Can you please help me with to code that I can use to read .Log file and then change '-' separated value to different column. The Content in the file is: Config

Flask application doesn't take into account the arguments in app.run()?

I have this issue : I use arguments to set the port and the debugger on like this if __name__ == '__main__': app.run(port=4200, debug=True) but it isn't ta

Parametric estimation of a Gaussian Mixture Model

I am trying to train a model to estimate a GMM. However, the means of the GMM are calculated each time based on a mean_placement parameter. I am following the s

unable to parse using pd.json_normalize, it throws null with index values

Sample of my data: ID target 1 {"abc":"xyz"} 2 {"abc":"adf"} this data was a csv output that i imported as below in python data=pd.read_csv('location',convert