2,206,483 questions
0
votes
0
answers
7
views
Loading pytest fixtures from separate Poetry package
I am trying to move some test configuration into a common Poetry package to avoid repetition of the same fixtures.
In a project there is a package named user-service with tests folder inside. Inside ...
1
vote
1
answer
40
views
One aync lock call or multiple async lock calls, what is better and safer in Python?
I trying to make ratelimiter for users in aiogram bot with middlware, now I created class for requests and class for ratelimiter, where reuqest are. My problem is what is better for performance and ...
-2
votes
0
answers
74
views
Why does my model keep getting stuck in one spot? [closed]
Problem Description
The RL code implements a Gymnasium-compatible environment (DoomEnv) for training reinforcement learning agents in DOOM Retro. It captures game state (observations) via shared ...
1
vote
2
answers
125
views
How can I set a placeholder (sentinel) without using None?
I have a value that always needs to be defined but may not always be meaningful, and I need a placeholder for when it doesn't yet have a meaningful value. Usually, I would use None as that placeholder ...
Advice
0
votes
4
replies
53
views
Why the R^2 value of test data is significantly different from R^2 value of train data?
I am working on a dataset for Housing pricing prediction problem. While I am trying to find an estimation between the features and the dependent variable price, I found there is a significant ...
-9
votes
0
answers
90
views
What is the purpose of the end parameter in Python’s print() function, especially in loops? [duplicate]
I am learning Python and came across the end parameter in the print() function.
By default, print() adds a newline after each output. However, I saw examples using end="" or end=" "...
2
votes
1
answer
42
views
Can't pickle _thread.lock objects when using multiprocessing.Pool with a class-based Logger wrapper
I am trying to parallelize a data-processing task where I've wrapped my logic inside a class. Each instance of the class is supposed to log its own progress to a centralized log file. However, as soon ...
2
votes
2
answers
102
views
How to maintain scale when rotating?
I've been messing around with OpenGL/ModernGL in Python/Pygame, and after getting my images rendered to the screen, I have been having issues rotating them.
I'm aware of the order that I need to ...
1
vote
0
answers
37
views
Error "InvalidVersion: Invalid version: 'unknown'" when triying to load netcdf files using xarray
I'm trying to load some .nc files this way:
ds = xr.open_dataset('path/to/file.nc')
At first I get no error message, but when I try to operate or simply visualize the data I get this really long ...
3
votes
2
answers
91
views
Fusing row with previous row(s) depending on criteria
I'm trying to fix a CSV file I received in which actual new lines were inserted throughout the data, effectively splitting one row of data into multiple ones with incomplete columns. The line breaks ...
Advice
0
votes
6
replies
102
views
Is yml easier then python?
I know it seems like a very stupid question, but my brother said it was easy, so I wonder now if yml is easier than python. He says it's just remembering names and values which does make it seem ...
Best practices
1
vote
2
replies
39
views
How to create a functional test on an existing resource on Google Cloud?
Let's take a concrete example. I created the following my_function Python function:
from google.cloud.aiplatform import Endpoint
def my_function(existing_endpoint: Endpoint)-> str:
return ...
Tooling
0
votes
4
replies
78
views
Why is the code not working, even after import ing it
from selenium.webdriver.support import expected_conditions as EC
import time
\# 1. Setup Service and Driver
service = Service('C:/Users/HP/Desktop/Drivers/chromedriver_win32/chromedriver.exe')
driver ...
-2
votes
2
answers
124
views
How do I return a input value? [duplicate]
I'm trying to return the "user_input" variable in the while loop in the "make_user_choice" function. I don't know how I should go about this.
Here's my code:
import random
"&...
Best practices
0
votes
3
replies
62
views
SQL-Test-123456789_question
What sql function will display first 4 terms in a string. string are of 10-25 in total length. string can be number or letters. results should be sorted in descending order. data is for hockey ...