2,204,864 questions
Score of 3
1 answer
25 views
How can I prevent duplicate Celery tasks when a FastAPI endpoint is retried?
I'm using FastAPI + Celery + Redis + PostgreSQL for a document-processing workflow.
A FastAPI endpoint creates a processing job and then sends a Celery task:
@app.post("/reports/{report_id}/...
Score of 5
2 answers
52 views
Python match-case vs dictionary performance internals
When conditional branching logic grows large in Python, the advice has always been to map keys to functions or values using a dictionary lookup mapping.get(key) to achieve O(1) time complexity, rather ...
Score of -2
0 answers
70 views
Raspberry Pi - robot [closed]
I am trying to make a small robot with raspberry pi 3, Arduino uno and python sockets. Here is my code :
On windows, i open the server socket and i send the command like so :
def ...
Score of -4
3 answers
62 views
How to plot specific data types in matplotlib
enter image description here
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib
import csv
import numpy as np
import seaborn as sns
# Show the figure.
data = pd.read_csv("/...
Score of -5
0 answers
64 views
how do i make a program with tkinter that lets me add a word and its meaning [closed]
This program is when you type in a word that is the library and you get a definition. I want it to be that when the word is not in there you can add it and its definition by typing it in and pressing ...
Score of -5
0 answers
51 views
Why doesn't Tenacity's retry decorator retry when requests.get() receives a status code? [closed]
I'm making an API request and expecting the "ID" value from a JSON (e.g. buc0AAAAMAAJ). However, because I was getting a 429 status code, I used the retry decorator to increment the wait ...
Score of -4
0 answers
53 views
SIH hackthon guidance [closed]
I want to build an app in Python, but I am struggling to decide how to structure the project and which backend approach to use. My goal is to create an application where farmers can view crop prices, ...
Score of -3
0 answers
55 views
FI/FR Python project server deployment issue [closed]
Server is RHEL 7.9.
Python Version 3.11
I need to deploy the FI/FR python project that is connected to Milvus Vector Database.
I have the Milvus installed in my laptop through docker.
I have been ...
Score of 2
1 answer
62 views
Running into build wheel error installing specific version of Frida, unsure how to proceed
I am currently trying to install a specific version of frida (12.2.1) and keep running into a build wheel error (see below for entered prompt & errors). I am working in windows 11.
I should also ...
Score of 0
1 answer
180 views
Why does typing break when I convert my classes to generic classes?
In the first example below are some classes representing nodes and node items in a node tree with a corresponding string path. I wanted to convert these classes to generics so I can use them for paths ...
Score of 0
1 answer
63 views
Append column from multiple pandas dataframes while retaining filename
I have a series of files that I am cycling through in a for loop. I want to take one column from each file and save it to a new dataframe. I have the following code, which works well. However, I would ...
Score of 4
2 answers
119 views
SciPy spsolve / SuperLU SUPERLU_MALLOC failure despite available RAM
I am trying to solve a large sparse linear system in Python3.12 using SciPy. The linux server has 48 threads and 192 GB RAM.
My code uses scipy.sparse.linalg.spsolve() on a sparse matrix
i solved N = ...
Score of -3
0 answers
124 views
Why are my tracker id is labeled as -1, {tracker_id} in python? [closed]
I am trying to track the speed of all the vehicle from a video. But for some reason all the speed detected vehicles are labeled as -1.
This is the snippet of my code, I am following Roboflow's Speed ...
Score of -4
0 answers
113 views
How to get authorization code for Spotify API?
I'm trying to make a small application but I'm struggling with the authorization process.
From Spotify documentation, I infer that the authorization goes like this:
client_secret -> ...
Score of 0
1 answer
82 views
FastAPI Form() with List[Type] sends array as comma-separated string ("2,5") causing 422 parsing error in Swagger UI
Here's a Minimal, Reproducible Example:
from fastapi import FastAPI, Form
from typing import Annotated, List
app = FastAPI()
@app.post('/')
def create(arr: Annotated[List[int], Form()] = []):
...