2,207,527 questions
0
votes
0
answers
6
views
Browser not Responsive when using Profile
I'm using NoDriver Python with a chrome profile and I'm running into an issue where the browser some times enters into a corrupted state and NoDriver can't control it.
For example if I run the script ...
0
votes
0
answers
21
views
How can I reliably recover and preserve page numbers from legal-document HTML/PDF text in Python at scale?
I have a Python pipeline that processes legal opinions into structured JSON and rendered HTML. The extraction mostly works, but page numbers are inconsistent across source formats.
I’m trying to ...
1
vote
1
answer
39
views
Can't install pywifi in python terminal
While I was making a project, I realised that I needed the pywifi module to connect to Wi-Fi. When I tried to install it, it said that the word "install" was invalid. How do I fix this?
>&...
1
vote
2
answers
30
views
Why doesn't copy_on_write work when modifying a copy of an entire DataFrame?
With pd.options.mode.copy_on_write = True, the original should not be modified when writing to a copy. However, when I reassign a column of the copy, it affects the original.
import pandas as pd
pd....
Tooling
0
votes
0
replies
10
views
Broadcasting list of pytrees with each other without knowing the prefix a priori
I want to broadcast a list of jax pytrees with each other, where it is assumed that one pytree is the prefix for all others (but we don't know which pytree is the prefix in advance).
The solution I ...
Best practices
0
votes
0
replies
24
views
Looking for Easier Ways to Manage Data Objects with Value-Based Minimum Distribution Requirements
Idea
I want to take a relatively large cache of data (108k items, 80 data points per item) and sift through it to grab items at semi-random and generate small pools of items. Each of the pools need to ...
Best practices
0
votes
2
replies
48
views
FastAPI int model field
I have been trying to learn FastAPI, with a small project and now I need to add a database table with an auto generated int id as a field.
I want to know how to write this id field in Python models ...
Advice
0
votes
9
replies
102
views
How do I optimize my C++ Rubik’s Cube Solver code?
How do I optimize my C++ code?
In short: I reduced a SAT problem to a Rubik’s Cube, and then I solve that Rubik’s Cube using a solver written in C++. However, the overall environment runs in Google ...
-1
votes
0
answers
19
views
Regridding netcdf from lat/lon to Lambert conic conformal regular grid
I would like to regrid variables from a netcdf file defined on a regular lat/lon grid to the Belgian Lambert conic conformal projection (EPSG:31370: X, Y in meters).
The input netcdf file has the ...
0
votes
1
answer
45
views
Avoid re-running tests when using unittest with multiprocessing
We recently upgraded from Python 3.9 to 3.14 and it appears that the default start method for multiprocessing has switched from 'fork' to 'spawn' and it is causing some tests to fail, trying to ...
Best practices
0
votes
3
replies
70
views
Dataclass from dynamically created class
I am trying to create a dataclass from a dynamically created class. I am doing something like
[1] A = dataclass(type("ClsA", (), {"a":1}))
However, the attribute a is not ...
-1
votes
1
answer
68
views
Backend question with CSRF (FastAPI, AuthX, SQLalchemy, Pydantic...)
I'm trying to create simple API with login system and roles. I have a problem with my code:
from fastapi import FastAPI, Response, HTTPException, Request, Depends
from fastapi.responses import ...
Advice
2
votes
6
replies
90
views
Whatever happened to Fredrik Lundh's Tkinter Construction Kit tkinter3000?
There seem to be downloads available on the Wayback Machine here, but they're 20 years old, designed for Python 2, and give "unknown publisher" on Win 11. These unfortunately seem to be the ...
2
votes
2
answers
72
views
Using Python to group returned data from multiple table joins in MySQL
My database includes treatments (treatment_id) that are given to patients at different times during the day (due_time). I would like to display this in a GUI where each treatment has its own row and ...
Best practices
3
votes
2
replies
48
views
Recommended GenerationConfig for Medical Domain LLMs: Strategies to Minimize Hallucination and Ensure Factuality
I am currently deploying a Large Language Model (e.g., Llama 3 / Mistral) for a medical application, specifically for tasks such as clinical note summarization and extracting information from oncology ...