Questions tagged [python-3.x]
DO NOT USE UNLESS YOUR QUESTION IS FOR PYTHON 3 ONLY. Always use alongside the standard [python] tag.
python-3.x
343,683
questions
0
votes
0
answers
7
views
Global Exception Handler In flask
I am new to flask and python so please pardon me if the answer is obvious.
My flask app has a scheduler and which opens many threads at different time that do specific different work and also run some ...
2
votes
2
answers
41
views
How can I pad a list column in a polars dataframe until the length of the list equals to the size indicated in another column?
I have two columns in a dataframe, pad_size and pad_start:
# Example Polars DataFrame with arrays pad_start and pad_size
data = {
'pad_size': [5, 4, 3],
'pad_start': [[1, 2], [4, 5, 6], [7]]
}
...
1
vote
1
answer
35
views
Complicated triple sum in pandas dataframe
I have a pandas dataframe that looks like
import pandas as pd
data = {
"Race_ID": [1,1,1,2,2,2,2,2,3,3,3,4,4,5,5,5,5,5,5],
"Student_ID": [3,5,4,1,2,3,4,5,4,3,7,2,3,9,10,2,3,6,...
0
votes
1
answer
22
views
Error 'Package is not compatible' in requirements.txt file in Docker container
I am getting a Error:
Downloading pytz-2024.1-py2.py3-none-any.whl (505 kB)
ERROR: Ignored the following versions that require a different python version: 1.19.4 Requires-Python >=3.5, <3.9; 2.5....
-1
votes
0
answers
16
views
Cookie isn't getting picked up by frontend, also disappears on refresh
I am developing this website using python3 backend and react frontend. I tried to set cookies for auth however no matter what setting i try the frontend just does not recognise it, and on refresh the ...
0
votes
0
answers
12
views
Is Async Call Applicable when there is a single rest call?
I am implementing a simple project in Python where I make one Rest call to fetch some JSON response, manipulate that response, and display the result.
Step 1: Make a Rest call, get a response
Step 2: ...
0
votes
1
answer
24
views
How to create extended dict Class requiring key/values on get()
I'm trying to build a custom class that will require keys and/or values when getting them from a dict. This is a simple version of what I have written, getRequired and is only checking for keys.
class ...
0
votes
1
answer
45
views
How to safely run a python script indefinitly?
Im planning on making a script on python that monitors some external parameters and act based on the retrieved data. The check basically is do an http call on a server on the network, and if the ...
0
votes
0
answers
16
views
Why is my IDF Python code running much slower than pyspark
I am creating IDF values and my python code runs much slower compared to the pyspark implementation (2+ hours for mine versus seconds) and I am interested why that is so. I know pyspark is Java based, ...
0
votes
0
answers
16
views
Pandas interpolate on 2 missing values based on different columns and other specific filter function after groupby
After a groupby on a date column I would like to interpolate on 2 specific values based on different columns and also retrieve the value of another for which the sum of two columns is minimum ...
I ...
-1
votes
1
answer
26
views
How do I run thenSelenium scraper faster?
I need to scrap data instantly (5-10 sec), but my code works 60-80 sec.
if I a have better and faster idea, please let me know. It does not matter whether by the Selenium or even another language.
...
0
votes
0
answers
21
views
'Not connected to voice.' Error for my discord music bot
I'm a fairly new developer and have always wanted to make a discord bot. So the problem is kind of weird when the bot is playing a song and I want to queue a song the queue is added but when I click ...
0
votes
1
answer
25
views
Fatal error in launcher: Unable to create process using 'python.exe' and 'pip.exe'
I am encountering an issue while trying to use pip to install packages in Python on Windows. Whenever I run pip install package_name or any pip command, I get the following error message:
Fatal error ...
0
votes
2
answers
43
views
Errors when using abstract methods in Python when calculating
I am writing code for calculations, I started testing and ran into a problem, an error pops up when trying to get an answer:
Traceback (most recent call last):
File "G:\LARIS\tests\...
0
votes
0
answers
29
views
How to resolve cx_Freeze error about pdf2docx mupdf import?
I've never posted here before, but this time I'm genuinely stuck. I'm using cx_Freeze on a python script that uses pdf2docx. Running the python script normally works fine, but running cx_Freeze's ...