Category "python"

POST HTML FORM verificaton doesn't work with Django

I am currently learning Django,I connected my register FORM with my views.py, and wrote a little backend code, the problem, is that it links successfully with m

What is the fastest way to get all documents of a collection?

I have a problem. I want to get all documents of a collection with ~ 1 mio documents inside. I asked myself what is the fastest way to get all documents inside

How to convert the following R code to Python code

The code drops the columns that are not required from the table: inputData <- inputData[,!(colnames(inputData) %in% c('col1','col2',''))] Need help converti

Formating a frequency dataframe to a table and a histogram

If I have a frequency table like below: ret < -1(%) -1 < ret < -0.5(%) -0.5 < ret < 0(%) 0 < ret < 0.5(%) 0.5 < ret <

How to covert labels array into one vector of letters

I have the labels as the following: array([[1., 0., 0., 0.], [1., 0., 0., 0.], [1., 0., 0., 0.], ..., [1., 0., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]], dty

Is it possible to interact with PDF-VIEWER (Selenium or other tools)?

This issue has been driving me crazy lately, I've been looking all over the internet for days and just found unaswered questions. Is it possible in any way to i

Can't use Keras MeanIoU to train semantic segmentation model

I'm working on a binary semantic segmentation problem. I built an UNet model with MobileNetV2 backbone. Here is my model code: def upsample(filters, size, apply

converting recurrent to bi recurrent

I want to convert this below RNN into bidirectional RNN, how can I do that? #Call the function and compile the model. model = RNN() model.summary() model.compil

Actual meaning of 'shell=True' in subprocess

I am calling different processes with the subprocess module. However, I have a question. In the following codes: callProcess = subprocess.Popen(['ls', '-l'],

Cron job: how to run a script that requires to open display?

I want to set up a cron job to run a python script, but it gives me this error: RuntimeError: could not open display This is because I import a module that

How to manage values for a kivy Spinner widget in kv?

I'm trying to implement a feature that would change spinner values (dropdown items) depending on which button was previously pressed. But for some reason, any a

Problem with getting testnet data from binance

I am trying to get trade data from the Binance API using the testnet server. The code I have written runs, however, I am trying to collect data for daily interv

How to run coverage for a Python project with src-layout?

My python project is structured in the so called src-layout. hyperorg ├── README.md ├── setup.cfg ├── setu

Lithuanian stemming algorithm

I've been trying to execute lithuanian snowball stemmer in Python. There is a github link where a guy shows how to integrate it using Python but I'm stuck at co

python async with AsyncKernelManager and Qt not executing

I'm trying to execute code inside a jupyter kernel in a Qt application. I have the below snipplet that is supposed to asynchronously run the code and then print

How to error handling curl and mysql in python subprocess.run()

I have python script which uses subprocess.run() getting dump file by curl and input dump file by mysql cmd = "curl {0}/{1} -o /tmp/{2}".format(dir_name,file_na

Python: I have a list of dictionaries but when I try to call a specific Key and Value it is throwing a error

def readParksFile(fileName="national_parks(1).csv"): nationalParks = open(fileName) headers = nationalParks.readline() keys = headers.split(",")

django if user.is_authenticated not working but login user

my problem is that the login operation is done correctly and the session is set up correctly, but user.is_authenticated does not work. The point is that it work

Python code for ozone reaction in FDM scheme

How can I use the Forward method for finite-time differencing to build a single box model for a third-order ODE? Just so you know, I am a beginner in coding in

Keras model with 2 inputs

I am dealing with a binary classification problem that feeds a network with two inputs (images), model_vgg16_conv = VGG16(weights='imagenet', include_top=False)