Category "python"

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

Could not install packages due to an EnvironmentError: [WinError 5] Access is denied [duplicate]

ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\Users\Sampath\anaconda3\Lib\site-packages\~5p

RestrictedPython: Call other functions within user-specified code?

Using Yuri Nudelman's code with the custom _import definition to specify modules to restrict serves as a good base but when calling functions within said user_c

Date and time with time zone

My datetime looks like this: date_time = "2022-02-17 08:29:36.345374" I want to convert this to another timezone, the API which I am using have a info of for

FastApi pydantic: Json object inside a json object validation error

There is a nested rule of class DocumentSchema in pydantic written in FastApi as follows: class DocumentSchema(BaseModel): clientName: str transactionId

MYSQL workbench 8 Migration wizard error "SystemError: TypeError("'>' not supported between instances of 'NoneType' and 'int'")"

I've been trying to migrate a PSQL (v13.4) database to MySQL (8.0.26) with the Migration wizard tool from Mysql Workbench. I've had to change some code from "db

Raspberry pi pyaudio - same output device - two python scripts?

I am trying to write out a stream audio into the same output device but through two python scripts. It says that i can have 2 max outputs, but when starting the

Making a discord bot able to handle several inputs at once

This is a pretty basic question but here is the issue. I am trying to make a discord bot that takes a message and delays it by a set amount of time. However, it

Issue Brownie setup, not sure if ganache installed properly - chainlink hackathon

I am new to this space and having an issue getting brownie to run my first deploy script. I am learning through the Chainlink Hackathon and following the browni

scikit-learn neural net beginner - results not what I expect

I have a simple example for which I am attempting to perform a classification using the MLPClassifier. from sklearn.neural_network import MLPClassifier # What

Multiple Fonts In A Matplotlib Title

I am currently leveraging Matplotlib to generate a variety of graphics and want to use a series of custom fonts. I am specifically using the Milliard font packa

Add custom seasonality in fbprophet

I have a dataset with monthly frequency(one record per month). It has two seasonalities in it: 12(monthly) 96(8 years) How do I add these in my fbprophet model

How to I make a image from numpy array in python?

I want to map each numpy array to a color to create an image. For example: if I have the numpy array: [ [0 0 1 3] [0 2 4 5] [1 2 3 6] ] I want to make an ima

How to substract two dataframe when index does not exactly match the index of the other data frame

I have the following Dataframes DF1 Index Val Index1 5 Index2 5 Index3 5 Index4 5 Index5 5 Index6 5 Index7 5 DF2 Index Val Index1 2 Index2 2 Index3 2 Index4 2

eofs.xarray raising TypeError (Using a DataArray to construct a variable is ambiguous)

I'm working on a multidimensional dataset using xarray and had some issues with eofs, the EOF analysis package, and particularly, with its xarray interface. My

Why does Tkinter image not show up if created in a function?

This code works: import tkinter root = tkinter.Tk() canvas = tkinter.Canvas(root) canvas.grid(row = 0, column = 0) photo = tkinter.PhotoImage(file = './test.g