Category "python"

while data == 1 run action one time

From an api, I receive a data. It returns two values: 1 and -1. I receive one data per second and in series of 1 or -1. What I want is that when data goes to 1

How to create a custom command prompt in python

We have a CLI tool which uses Typer module in python. However, I want to create a custom command prompt - like the mysql prompt for example. mysql> Currentl

pandas dataframe not posting correctly to excel

I've an excel sheet "Calcs" with 1 column name "old". I'm trying to add new column "new" with a fixed value of "1" to existing sheet "Calcs" and am using below

Python - Can't divide column values

I'm trying to divide each value of a specific column in df_rent dataframe by simply accessing each value and divide by 1000. But it's returning an error and I c

POST request gets blocked on Python backend. GET request works fine

I am building a web app where the front-end is done with Flutter while the back-end is with Python. GET requests work fine while POST requests get blocked becau

Find strings in a list that between specific ascii values - Python

I am trying to find certain string in a list that are between a lowerbound and upperbound (these are user input values). For example say I have a list, states =

How to implement synchronous producer call in RabbitMQ

I am currently looking to develop a synchronous workflow in a RabbitMQ producer-consumer setup. The producer will publish a message to the queue and it will tak

apk: not found, even with python:3.9-alpine

I am trying to build docker image: FROM python:3.9-alpine ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 ... But, I got this error: Building app Step 1/

Name from other page included in other page is not displayed

In my application, I would like to include the name, entered by the user, at page one, to the second page. But when I paste the jinja print "{{ data }}" to the

Jenkins - Continuous deployment for (non-stop running) single-file python application

I have made a simple telegram bot in Python. All code is in one .py file. Trying to achieve "continues deployment" I installed Jenkins, and with the GitHub plug

How to modify handle method in socketserver

I am learning the socketserver module and I am following the example but I modified the handle function a bit class CustomServer(socketserver.BaseRequestHandle

Can't calculate g(x) as Derivative(f(x))

Hello! Problem: I can calculate xp(t) and xh(t) for any given t value, but not for ġ(t). Context: I'm calculating a general solution for a vibration system

Error is -database link of same name has an open connection Error

del_db='drop database link my_db_link' cur.execute(del_db) This is a simple query to drop the link database which is executed in SQL developer but it getting

Fine tune/train a pre-trained BERT on data with no sentences but only words (bank transactions)

I have a lot of bank-transactions which I want to classify into different categories. The issue is that the text is not a sentence as such but consists only of

How can I convert a PureWindowsPath to a Iterable?

I'm working on an academy project to encrypt some files I have managed to encrypt all files from one folder but when there is a folder into that folder i get er

Python program have json error on exe file

I want to convert my program to exe but program shows these errors. I have this error if I made near the exe file json file with name notes_data.json If i have

Azure Functions with python, html page & beautifulsoup

I am new to azure functions. What I am trying to do is to get my azure function to open the index.html page, however I am not sure how to pass in the variable d

While Loop Not Working (Function and Time.Sleep)

My while loop prints nothing when it is running. import os import time place = 10 running = True def Write(): j = 1 for i in range(place - 1): print(

convert price to groups of price category getting (ValueError: Bin labels must be one fewer than the number of bin edges)

category= pd.cut(df.price,bins=[75000,100000,250000,500000,1000000,2000000,4000000,7700000],labels=['7','6','5','4','3','2','1','0']) df.insert(5,'price categor

Draw a line between points, ignoring missing data, with matplotlib

Numerous similar questions have been asked over the years, such as this one here, but none of the accepted answers solve my problem. The following code: x=[0, 0