Category "python"

Python Pandas how to get f-string to work in an url

I am getting an error of urllib.error.HTTPError: HTTP Error 404: Not Found. I feel like f-string should work for the url but it is not how would I fix this? imp

Unable to start an application using pywin32 package - invalid class string error

I have installed Python 3.10 and installed the pywin32 package. I tried to open an application using Python, however I am facing an error: "invalid class string

How to synchronize a windows folder in python flask app with a sqlite database table?

I am looking for a solution to compare filenames inside sqlite database with filenames in a windows directory (app.config['UPLOAD_FOLDER']). I have a sqlite da

matplotlib multiple line plot color according to reference value

If i have a dataset: import numpy as np import matplotlib.pyplot as plt y = np.array([np.random.randn(10) for k in range(100)]) plt.plot(y) And a correspondin

Pycaret classification.compare_models does not display results grid

From the documentation and tutorials for pycaret, I expect the classification.compare_models() function to return a grid such as... Model Accuracy AUC Recall

download specific image from the list

my manager asked me to create script to download images for our client. These are images for goods on a market place. Every image exist on a separate page about

python automatically change a variable from list to string inside a for loop

Python automatically changes a variable from list to str inside a for loop so I got an error when I append to the list. Why does this happen?

Completing the sudoku terminal game

Given below is a program to make and solve ( by the user ) a sudoku puzzle . import random from tabulate import tabulate base = 3 side = base**2 level = 1 de

how do you make a transparent overlay for a specific window that doesn't block interactions beneath said overlay in pyqt5

Im trying to make a simple helper overlay that display info over a window but doesn't interfere with interactions on said window(click through overlay). I prefe

Remove list in lists that satisfied the condition

I'm trying to make a quick OCR for specific use, I know should've just write a preprocessor for normal OCR and that would been faster but this idea came up to m

How can i get raspberry pi pico to communicate with PC / external devices

For example when i give 5 to the code, i want to turn on the led in our rpi pico (rpi pico connected to pc with cable) #This code will run in my computer (test.

Problem Installing azure-pipeline due to ruamel.yaml

I am trying to install azure-pipeline using: pip install azureml-pipeline When I do this it installs most dependencies fine until I receive the following error

Why tesseract is not recognising text from this image?

I am trying to get the text from these images. When I run the code is below, in the first picture recognize "Legendary x" but the second picture doesnt recogniz

How to emulate clicking on coordinates on android in the editor on android python

On my device there is a safe from which I forgot the password and I want to sort through all the passwords through auto-clicking on python. The problem is that

Merging excel workbooks into one using xlwings

I am currently trying to merge a number of excel spreadsheets into one workbook to create a monthly master workbook. I have written the following code to try an

How to read JSON that has values in parenthesis with data type?

I have JSON file built like the following: "key" : DataType("value") Example - [ { "timestamp" : ISODate("2022-03-10T13:50:51.688Z"), "some_field" : ObjectId("

GirdSearchCV for multioutput RandomForest Regressor

I have created a multioutput RandomForestRegressor using the sklearn.ensemble.RandomForestRegressor. I now want to perform a GridSearchCV to find good hyperpara

Best way to provide admin role from Django REST to ReactJS

The default django user model has a is_superuser field. I would like to use this field to conditionally render components in react, i.e. get something like this

How to directly save spectrogram image to specific pixel size

I am generating spectrograms and casting them to images for use in a CNN. How can I directly specify the pixel size of the spectrogram. This is what I have so

1TypeError: document must be an instance of dict, bson.son.SON, bson.raw_bson.RawBSONDocument, or a type that inherits from collections.MutableMapping

I am new at pymongo, but have a decent knowledge on mongoDB So basically I have a list of strings, then I converted it into a dictionary using key as integer, s