2,211,666 questions
0votes
0answers
7views
Modify list of arrays in place
I have a df like: # /// script # requires-python = ">=3.13" # dependencies = [ # "polars", # ] # /// import polars as pl df = pl.DataFrame( { "points"...
0votes
0answers
8views
sql llte alchemy generates select order by with alphavabet number instead of numerici order
Python Sql Alchemy generates select for sql lite ordered by with alphabet number Given City Table in Sql lite generated from sql alchemy: class City(Base): __tablename__ = "city" id: Mapped[...
0votes
1answer
18views
How to modify a time with datetime.timedelta and then format it with datetime.date.strftime?
I can find the date of next Sunday (or today if today is Sunday) just fine using timedelta with the line: print(datetime.date.today() + datetime.timedelta(7 - int(time.strftime("%u")))) And ...
1vote
2answers
22views
Why does __init__ requires an explicit self as an argument when calling it as base.__init__()?
I know of two ways to call a superclass's constructor from a derived class: super().__init__() and base.__init__(self). Why does the second require me to explicitly supply self as an argument? Here's ...
0votes
1answer
41views
How can I store `id`s in Python without paying the 28-byte-per-int price?
My Python code stores millions of ids in various data structures, in order to implement a classic algorithm. The run time is good. But the memory usage is awful. These ids are ints. I assume that ...
-1votes
0answers
14views
I have some problem for creating virtual environment in whith pip. Please how can i fix this? [closed]
When I want to create a virtual environment in my shell, I have this message: Error: Command '['C:\\Users\\YUNIWO COMPUSSSSSSSS\\python\\projet_1\\env\\Scripts\\python.exe', '-m', 'ensurepip', '--...
0votes
0answers
9views
invalid_client or unsupported_grant_type in djnago testcases
This is my code which is a simple signup and login and I'm trying to login via oauth2 class UserAuthTests(TestCase): def setUp(self): self.client = APIClient() self.user = CustomUser....
0votes
0answers
17views
Imported module returns to main module unexpectedly
I import a module expecting the imported module to handle some database maintenance based on variables passed from the main menu and display a customer maintenance window. The imported menu does not ...
0votes
1answer
15views
sketch partial regression chart using dash
i have dataframe, in which we are given x and y columns and between them i want to sketch regression model, main idea is that i should use dash framework, as according chow test , there could be ...
0votes
2answers
44views
I did some inline code for an assignment and I was wondering if using it would be more efficient with or without
The goal of the assignment was to initialize an empty list called rand_array then fill it with 10 unique random numbers I figured out the assignment normally as per the teacher's directions: import ...
-4votes
0answers
21views
Who does have experience with CatVTON? [closed]
I'm building an offline, company prototype e-commerce app with virtual try-on features connected to our private server. Can CatVTON support this? I have tried to do it but I'm not familiar with ...
-4votes
3answers
51views
Problem with for loop execution in Python [closed]
Question Body: Hi, I'm trying to write a for loop in Python, but it only runs once. Here's my code: for i in range(5): print(i) break How can I make it print all the numbers from 0 to 4? (...
-5votes
1answer
54views
How does Python convert a string with only numeric characters into a int using int() function
after looking into a lecture I have encountered a small problem. I don't understand the steps or how Python converts a numeric value inside a string into a int(or even a float) using there int() or ...
0votes
1answer
20views
cronjob hour setting is being ignored in docker alpine container
I created a script called 'main.py' that does a little web scrape and sends an e-mail with SMTP. I set up a cron job to run the script three times a day - at 12:00, 18:00 and 21:00 (UTC-3). I didn't ...
0votes
1answer
29views
urlparse/urlsplit and urlunparse, what's the Pythonic way to do this?
The background (but is not a Django-only question) is that the Django test server does not return a scheme or netloc in its response and request urls. I get /foo/bar for example, and I want to end up ...