209 questions from the last 7 days
0
votes
0
answers
16
views
Noiseless Gausian Proces regression not crossing the training points
I'm trying to perform a Gaussian Process Regression on the following series of data points (X and Y):
X Y
0.00001 -6.8200000000000003
0.00014 -6.8073846153846160
0.00042 -6.6818333333333326
...
0
votes
0
answers
22
views
Why does the titlebar crossfade transition work one way and not the other using libadwaita?
In the first code example, there is a crossfade animation that happens between changes.
import sys
import gi
# Require specifically GTK 4.0 and Adwaita 1
gi.require_version('Gtk', '4.0')
gi....
0
votes
0
answers
25
views
Error throwing while building opencv with gstreamer support
I am trying to build opencv from source to enable GStreamer support. I have followed this instructions here, but an error occurred. More specifically, the error occurred in this step:
make -j$(nproc)
...
-2
votes
0
answers
75
views
How'd you make algorithm that'll find shortest way to sort sequence of numbers just by applying function f(x) that will make x to closest lower prime? [closed]
Imagine you get sequence of integers:
[a1 a2 a3 ... an]
where:
1 <= a <= 10^6
1 <= n <= 10^6
You are given a function f(x) that can change a number to the closest lower prime number, or ...
0
votes
1
answer
41
views
How to Create a Pandas Dataframe from JSON Nested Objects
I'm trying to create a Pandas DataFrame from a JSON file that looks like this:
{
"GameID": "1,218,463,841",
"Date - Start": "1761097369",
"Date - End&...
1
vote
1
answer
75
views
Why does my Python solution for selecting 2 points from each interval give incorrect results for overlapping intervals?
I’m trying to solve the following Leetcode problem:
You are given a 2D integer array intervals where intervals[i] = > [starti, endi] represents all the integers from starti to endi
inclusively.
A ...
-1
votes
1
answer
38
views
My Code With Openrouter api is not working
I'm trying to automate intraday financial analysis using OpenRouter's free models. My Python script rotates through several LLM endpoints, sending a prompt about a stock's symbol, change, and closing ...
0
votes
0
answers
58
views
Running a tool with uvx from a private repo using an access token
I want to frequently test a Python application I'm developing with uv, which I publish to a private repository on a GitLab instance. I've generated an access token with read access to the repo and I ...
0
votes
0
answers
24
views
How to replace a Twine upload with uv publish?
We have an internal tool that was distributed simply by users cloning the git repository. The purpose of the tool is to configure newly created virtual machines for later testing our "real" ...
1
vote
0
answers
44
views
Detecting human presence in a WhatsApp chat to pause a chatbot (Python)
I'm developing a WhatsApp chatbot in Python and want to implement a human handover feature. The goal is to temporarily pause the bot's automated responses when a human administrator opens the chat to ...
Advice
2
votes
2
replies
42
views
Chapel-Python interopability - export records (or interface with Python dataclasses)
I have the following use case. My main program is written in Python, and I want to accelerate some parts of it. The Python program makes use of dataclasses (~structures) to store parameters, arrays, ...
0
votes
2
answers
52
views
pytorch Module B=A, A.to('cpu'), but the tensor in B is still in GPU, why?
After converting module A to CPU, the origin parameter tensor still stays on the GPU? When it is released? Is it wrong if I reuse the parameter?
My code:
import torch.nn as nn
class A(nn.Module):
...
Best practices
0
votes
0
replies
33
views
Trying to make it CTk, but STATE not working
I have this script in Tk and it works fine. I wanted to make it dark and ad hover options, so I changed it to CTk, but now it's not working. Can someone please help me fix this? I have both scripts ...
Best practices
0
votes
3
replies
63
views
Searching through Unicode text with an ASCII keyboard in Python
I have a corpus of text which includes some accented words, such as épée, and I would like people to be able to easily search through it using an ASCII keyboard. Ideally, they would simply type ...
-5
votes
0
answers
48
views
how do captcha solving services get the captcha in order to see the challenge? (in order to solve it) [closed]
How do you even load a captcha from one browser onto another/ even see the problem?
does anyone have code examples how you can sort of stream captchas from a page to a secondary page? or just even ...
Advice
0
votes
6
replies
77
views
How to import an editable package?
I've installed a package from a cloned repository, in "editable" mode (pip install -e .). I can't import the package in a script in the virtual environment where the package in installed (...
-2
votes
0
answers
33
views
Flask/Jinja2 Error: Custom Template Filter Not Found [closed]
Why does my Flask app not recognize the custom filter I created?
-1
votes
0
answers
26
views
For Meshtastic Python API [closed]
When I run this segment of code every item in the list is executed even printed out in the statement, however the last message in the array is always never arrives to the other node as if it is being ...
1
vote
1
answer
37
views
Pylint `arguments-differ` not applicable to constructor of a child class
Consider this
class Base:
def __init__(self, bar: bool, **kwargs) -> None:
self.bar = bar
def foo(self, bar: bool, **kwargs):
...
class Child(Base):
def __init__(self,...
-1
votes
1
answer
47
views
Moving a figure around the screen using control keys [duplicate]
The figure moves in different directions: left, right, up, and down. While moving, it should also fire in the direction it's moving when the space bar is pressed. In this code, when moving to the ...
0
votes
1
answer
48
views
How can I put the label in the frame on the left side on Tkinter? [duplicate]
I want to put the "Selecto a file to encrypt" on the left site, a try it separate too and it didn't work.
tk.Label(frame, text="Select a file to encrypt: ", fg="black")....
0
votes
0
answers
33
views
Trying to install a package with homebrew results in no package manager error
I have an Intel Mac and I'm trying to install Firedrake to use in python. I followed the instructions and ran
$ brew install $(python3 firedrake-configure --show-system-packages)
but I got this error:...
3
votes
1
answer
49
views
PaddleOCR is leaking extracted data from a previous document
I've implemented an OCR queue using PaddleOCR and noticed that some documents are receiving the same extracted data as the previously processed document.
So far, this behaviour seems to be isolated to ...
Tooling
0
votes
1
replies
44
views
How to export or import TOON in pandas?
Good day,
I would like to know how to export or import TOON (Token object oriented notation) in pandas.
Thank you.
-1
votes
1
answer
57
views
Incorrect type hint for name parameter in binary_var_list [closed]
The binary_var_list method in the docplex.mp.model API has an incorrect type annotation for the name parameter.
Current signature:
def binary_var_list(self, keys, lb=None, ub=None, name: type[str] = ...