2,208,771 questions
-2
votes
0
answers
21
views
Suspicous Python Program [closed]
import random
cells = [
[0,0,0],
[0,0,0],
[0,0,0],
]
cell = 0
print("welcom to kresteke noli")
raund = True
while raund:
print("game board")
print("...
0
votes
0
answers
17
views
PIP showing ModuleNotFoundError while upgrade/downgrade
im trying to downgrade pip to 18.1 for pyinstaller and it shows me the same error every time
ive uninstall and reinstalled urllib3 and requests yet i have the same issue
command: python -m pip ...
0
votes
0
answers
16
views
Poetry: set env POETRY_REPOSITORIES_*_URL with partial url from gitlab
ex:
# pyproject.toml
my-package = { git = "https://gitlab.com/group/my-package.git" }
# envs
export POETRY_HTTP_BASIC_GITLAB_PASSWORD="xxx"
export ...
0
votes
0
answers
22
views
Multiframe ZSTD file: how to jump to and stream the second file?
I compress two ndjson files into a multiframe ZST file where each ndjson is compressed into a frame. I have the following metadata meta_data (as a list) of the ZST file:
import zstandard as zstd
from ...
-8
votes
0
answers
62
views
I made this game How should i improve it? [closed]
import time
import random
score = 0
while True:
print(f"Guess how long you wait from this message to the next one. Your score is {score}")
random_number = random.randint(1, 5)
time....
-3
votes
0
answers
39
views
How to design an explainable AI pipeline for model predictions? [closed]
How can I design an end-to-end explainable AI pipeline where every model prediction can be understood, justified, and audited?
I want explanations at:
Feature level
Individual prediction level
...
-1
votes
0
answers
59
views
Is there a way to capture the return value of a method that is called in the call stack?
Currently using Python unittest and I would like to get the output of a function call bar. In my testing, I need to first call foo to get the proper workflow to pass into bar. However when I have a ...
0
votes
0
answers
31
views
Powershell Terminal Struggling with Subprocess
im currently trying to call/run python file b from python file a and it works, although all terminals except cmd struggle to let me work within this new opened python file i.e. i can only seem to type ...
0
votes
1
answer
33
views
Outbox pattern problem with postgresql in python
I have a problem and I don't have a solution for it, I am using fastapi and sqlalchemy and the project was working and then I used db.begin and I had to change the producer system because I am using ...
Advice
0
votes
5
replies
47
views
Find strings with longest common prefix
I have a list of strings, for example:
["apple", "apply", "ape", "banana", "bank", "bat"]
Given an input string (e.g. "app"), I ...
0
votes
0
answers
25
views
Openpyxl deletes all cells values and styles that are below my inserted values
I'm using openpyxl to load a template .xlsx file, add data into it and save it. I do this so I can keep the original formatting of the file (style, colors, layout...). Part of the info I need to ...
Advice
0
votes
4
replies
22
views
Python: find index of list with highest average
I’m learning Python and working with a list of lists where each inner list contains numeric values.
Example:
scores = [
[80, 90, 85],
[75, 88, 92],
[90, 85, 80]
]
Each inner list ...
Advice
1
vote
5
replies
36
views
Find maximum value per group from CSV file
I have a CSV file with columns like:
student_id,subject,score
S001,Math,85
S001,Physics,92
S001,Chemistry,78
S002,Math,88
What I want to do is:
Filter rows by a given student_id
Find the highest ...
-7
votes
0
answers
46
views
Substrings and Highest score, python [closed]
enter image description here
Question 2: Substring
You are given a text file containing a list of strings, one string per line. Write a Python program
that reads the strings from the input file and ...
Best practices
0
votes
7
replies
49
views
Substrings in python
is this how you t reads the strings from the input file and writes to an output file all strings that appear as a substring of at least one other string in the list?
# Read input file
with open("...