Skip to main content
Filter by
Sorted by
Tagged with
Best practices
0 votes
2 replies
22 views

i have multiple lists of a bunch of strings gathered indiscriminately. i want to remove any that are unsuitable based on various criteria. import re asdf = ["apple", "dreamy", &...
soweli's user avatar
  • 1
0 votes
0 answers
17 views

I wanted the Python Fraction class to output mixed fractions. For example, I wanted str(Fraction(-7, 3)) to output '-2 1/3' not '-7/3'. So I implemented the following MixedFraction subclass: from ...
calamari's user avatar
  • 433
Advice
0 votes
3 replies
82 views

I'm not sure how to really motivate this question, but in playing around with integer hashes in Python (3.14.3, but I imagine this has been the case for many versions), I noticed that for almost any ...
JoDraX's user avatar
  • 121
Advice
0 votes
4 replies
52 views

I have a small Python script that requires a list of physical disks (not partitions or volumes) and their respective capacities. I'm using the pyparted module to accomplish this: readable_disks_dict = ...
oreganoid's user avatar
Advice
0 votes
0 replies
55 views

I need to do some processing and analysis on a large dataset of weather and hydrological data. The data I'm scraping from the host website is formatted like this: site_1 = [ ['1970-01-01 00:00', -1.40,...
Thomas White's user avatar
Advice
0 votes
3 replies
67 views

I'm implementing a simple stack in Python and I want to add the ability to undo the last pop() operation. The behavior I want is something like this: s.push(10) s.push(20) s.push(30) s.pop() # ...
Solomon Gleeson's user avatar
0 votes
0 answers
44 views

I am building an autonomous AI Agent (managing training workflows) that automatically generates PyTorch/OpenMMLab training scripts and executes them in a background subprocess. One of the common ...
user32496676's user avatar
-1 votes
0 answers
53 views

I am trying to fine-tune the MedGemma-9B model for a medical document auditing task. I am using a single RTX 4090 with 24GB of VRAM. However, I keep encountering a CUDA Out of Memory error right when ...
陳冠豪's user avatar
1 vote
1 answer
52 views

One of my Langchain tools returns the below error when the agent is invoked, and so the agent does not actually proceed after the program is run: groq.BadRequestError: Error code: 400 - {'error': {'...
RF2's user avatar
  • 21
1 vote
0 answers
55 views

I made my own 3D render with Pygame and added basic .obj import, but even a teapot lags a lot because vertices 2d array's length is long. How can I optimize code as much as possible inside game loop? ...
0i3's user avatar
  • 11
2 votes
0 answers
35 views

Why is my `mapped_column` function not auto-completing when I pass `insert_default` as a parameter? I'm using PyCharm as my IDE. class base(DeclarativeBase): create_time: Mapped[datetime] = ...
Landon_Sparrow's user avatar
Advice
0 votes
2 replies
51 views

I would like to know how to conveniently make sure that a scalar is automatically converted to a numpy array that can be indexed. Note that np.asarray(x) will not work, since if x is a scalar, np....
Quercus Robur's user avatar
Best practices
0 votes
2 replies
31 views

When trying to integrate HTMX into my Django app, I'm facing a design issue. My base.html file contains fixed layout elements (a navigation bar and a title). I created a container section with the ID #...
Bautista Ribotta's user avatar
Advice
0 votes
5 replies
84 views

for i in range(1, 101): score = random.randint(1, 100) print(f"Student {i}: {score}") if score >= 80: grade = "A" elif score >= 60: grade = "B" ...
David Oju's user avatar
0 votes
0 answers
53 views

I have two data series of model prediction and observations. I am able to make line plots of these series. I would like to add a linear regression fit of the two data series. i would also like to add ...
Zilore Mumba's user avatar
  • 1,610

15 30 50 per page
1
2 3 4 5
147170