Category "python"

Sum of different slices rows and column

I have pandas DataFrame df and three arrays columns_list, lower_boarder and upper_boarder all have the same shape. I want to find array with shape as input arra

pyvirtualdisplay - downloads are stuck as .part file

I have a python-selenium script running on a debian 11 server without any Desktop - thats why i use pyvirtualdisplay. The script has to login to a website and t

Getting average score from a text file in python?

I'm looking to have the program read a text file that is formatted like this for example. Kristen 100 Maria 75 Frank 23 Is there anyway in python to skip lines

Have subprocess.Popen only wait on its child process to return, but not any grandchildren

I have a python script that does this: p = subprocess.Popen(pythonscript.py, stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=False) theStdin=request.input.encode('

Selenium python : my current_url doesnt update after click

Im scraping a website where I need to retrieve values from the url when i click on a button providing different form values. I have a problem: when i click the

ValueError: There may be at most 1 To headers in a message

I am trying to write a very basic email sending script. Here is my code .. import smtplib from email.message import EmailMessage msg = EmailMessage() msg.set_c

Utilizing the Websocket Data from Android cellphone while running

Using SensorServer, I am establishing a connection between an android phone and Python and utilizing the data sent. The accelerometer of the Android device is u

How to store contents of string array into 2D array in python and perform operations without any built in function?

I have tried almost everything I cannot figure it out. I cannot figure out which array to use. This is the question and the required output:

Standard answers for a speech in a AI

I am building a project where there is a software, It should answer to questions as "Hi","What your name?", "How are you?", ecc. Is there a standard answers I c

How do I use an API key/secret on Binance's TestNet?

Following the instructions here, https://docs.binance.org/smart-chain/wallet/arkane.html, I created a Binance SmartChain account with its "0x" prefixed wallet a

How to Fix MyTile@SmartTile lags and slow fps

Hey Im Creating a delivery app with kivymd but i have been experiencing a lag when running and navigating through the app and slow fps when loading SmartTileWit

MongoEngine raw query not solved

Mongo engine cannot execute a raw query AppDocument.objects(__raw__={ {"_id": ObjectId("1"),"car._id": ObjectId("2")}, {"$pull":

Why is Tensorflow not recognizing my GPU after conda install?

I am new to deep learning and I have been trying to install tensorflow-gpu version in my pc in vain for the last 2 days. I avoided installing CUDA and cuDNN dri

FastAPI - Dataframe updated change lost between route

I'm trying to make a simple FastAPI api. Let's suppose these routes: The POST Route @api.post('/user', name='Get list of users') def get_user(user: User):

How to remove unwanted white space

Using python In my code: print('Menu') menu_items = ['pizza','burger','hotdog','salad'] menu_price = ['10','7','4','8'] print('0)',menu_items[0], '$', menu_pri

Why qt project can throw errors like undefined reference to `__imp_ Py_Initialize' and so on?

I want to add python functions in C++ code. The project is written using qt. In Mask.pro I have: ... INCLUDEPATH += "D:/workplace/Python/include" LIBS += -L"D:/

Trouble computing integral with scipy quad

I'm trying to compute the following definite integral: Integral I want to compute: where rho_ch is and a = 3.66 * 10^(-15) m (in meters) b = 0.54 * 10^(-15) m

How to get multiple combinations of multiple lists in python (Multiple n Choose K or nCr)

I have been looking on google and stack overflow for a few hours and I am sure there is an answer for what this is mathematically or perhaps it is just what the

How to print a nested list like a grid?

l1 = [[" "], [" "], [" "], [" "], [" "], [" "], [" "], [" "], [" "], [" "], [" "], [" "], [" "], [" "], [" "], [" "]] As you can see I want

python list No displacement

I have a list [{'sender': '0', 'recipient': '15839597-107f-4166-aff1-ac32d3794748', 'amount': 50}] and call this list elsewhere for create sha256 but list item