Category "python"

how do i port my machine learning model from python to java web app?

so I've been developing some machine learning models using sklearn and tensorflow in python . and I want to integrate it into a java web app. so far I've been s

fix the "element not interactable" exception?

I am trying to fix the following error from selenium, but right now I am not able to proceed. selenium.common.exceptions.ElementNotInteractableException: Messag

Building a package referencing a package in a parent directory in setup.py

I am trying to build a pip package from source code in a Git repository that has multiple packages that share a common package. (I am not allowed to change the

Problem with repetitive messages for whatsapp - python

I have been making a whatsapp chatbot with python, my problem is that it answers many messages, I think I have some open loop and I am not checking if the last

TypeError: 'int' object is not iterable - When trying to convert a string to a list

My code is as follows down below. However the x that I input into this function is not int data type, it should be a string. The other code will show you where

Rewriting SAS optimization in Python

I am trying to rewrite something similar to the following SAS optimization code in Python. The goal of the code is to find parameters for a continuous (in this

Iterating through XMLs, making dataframes from nodes and merging them with a master dataframe. How should I optimize this code?

I'm trying to iterate through a lot of xml files that have ~1000 individual nodes that I want to iterate through to extract specific attributes (each node has 1

cv2.VideoCapture inconsistent behavior between cap.set and loop read

I was trying to read the 600th frame of a video using cv2.VideoCapture. However, I found that the following two methods both successfully read an image but the

Split second level multindex column to create three level column in Pandas

Given a multiindex df X E1_ex0 E1_ex2 E2_ex0 E4_ex0 0 3 4 1 1 1 4 3 2 0 I would like to s

Python: Creating nested dictionaries, using keys stored in a list

EDIT: I forgot to mention that there are other dictionaries and lists, and the solutions suggested so far work very well for my example, but not if I want to ad

how to click on pop up elements using undetected chromedriver

i am trying to make 5-star bot i have already done half work for getting login with gmail only place i am stuck is when it come to clicking on pop up window ask

How to solve CompileError: command 'gcc' failed with exit status 1 while compiling?

I am trying to run "python build.py" by terminal on Ubuntu in a conda virtual env. But I got some below errors, you can see in the code! for your information: T

Django Framework : Problems with views settings

im learning Django framework and having some issues that i dont get it. Actually i have apps like Polls/ Blog/ and my homepage/ installed and working as i want

Dynamic TaskGroup in Airflow 2

I have a function run_step that produces a dynamic number of emr tasks within a task group. I want to keep this function in a separate file named helpers.py so

Finding the best linear section of data

I have some scientific data and wish to find the best region to fit a straight line in. Theoretically, the data should have a constant gradient but other influe

OpenCV - Correcting Image for Mis Alignment

I discovered the other day that my camera lens or perhaps tilted sensor is causing an object centered in front of the camera to appear off center in the capture

pytorch_lightning.utilities.exceptions.MisconfigurationException when training in pytorch lightning

I am training a sample model with dummy data then i got this error. I have gave everything properly but still i am getting this error: No `configure_optimizers(

Discord.py bot doesn't respond to commands but does on mentions

I have a problem with my discord.py bot. Here's a part of the code: import os, discord from discord.ext import commands from flask import Flask from threading i

How to add a comma after every three digits? [duplicate]

Add a character in between a string How can I add a comma after every three characters in a string? For example, i have a string number = "200

Python | Give list [1,2,3,4] -> return 1*2+2*3+3*4

So as i said in the title, i want to multipy each two neigbors in the list and sum them all - with a single code line. I'm looking for the most elegant and effi