2,206,477 questions
-1
votes
1
answer
24
views
TypeError: 'NoneType' object is not subscriptable? [duplicate]
The code is
print(score.sort(reverse=True)[:3])
And it makes an error
TypeError: 'NoneType' object is not subscriptable
What is the problem?
-5
votes
1
answer
57
views
How to build logic to solve any python coding questions? [closed]
Questions like:
How to reverse a string without slicing?
# Write Python code to reverse a string without using slicing
# string("DataScience"))
# Output: ecneicSataD
Write Python code ...
2
votes
1
answer
42
views
Issues with redirecting output text to a separate window in Python
I am very, very new to programming having just finished a semester-long course on Python. I wanted to take an existing program I had written for my class and redirect all the output text to a separate ...
0
votes
1
answer
45
views
MySQL query fetchall() result
I am currently trying to make a nested MySQL query using Python. But I am a bit confused about how the respond to a query that comes in a weird format with "()" and "," rather than ...
Tooling
0
votes
1
replies
29
views
Dockerized Streamlit RAG with Native Ollama & GPU/CPU Hybrid Logic
I am building a RAG Study Assistant and need advice on finalizing my Docker setup. I have a specific architecture in mind to maximize performance and portability.
The Architecture:
App: Streamlit + ...
-4
votes
1
answer
45
views
Handling a cross-click to close an app on Pywebview
I recently ran into a problem: I needed to create a pywebview app, but I wanted to customize the top control bar where the buttons for minimizing and closing the app are located. First, to make sure ...
-3
votes
1
answer
62
views
Why do I get a syntax error with set_thumbnail in Discord webhook using discord.py? [closed]
Even though the embed sends just fine when I don't attempt to add set_thumbnail, it gives me an error when I try to add it:
from discord import SyncWebhook, Colour, Embed
import requests
ABwebhook = ...
0
votes
0
answers
29
views
Opentelemetry in AWS Lambda leads to serialization errors
We have a setup where we use Lambda serverless flask application behind an API Gateway. We started adding Opentelemetry as an additional layer in the lambda function (arn:aws:lambda:eu-central-1:...
0
votes
1
answer
53
views
How to replace non-commutative products in SymPy with expressions?
I want to work around sympy's limitation of assuming partially commutative behavior. If I define the non-commutative symbols
import sympy as sy
u = sy.Symbol('u',commutative=False)
v = sy.Symbol('v',...
Advice
0
votes
1
replies
92
views
How to anonymize PII before sending data to GPT APIs?
I’m building an application that sends user-generated text to GPT APIs, but the data may contain personally identifiable information (PII) such as names, emails, phone numbers, or account details.
...
-3
votes
0
answers
91
views
Why does my translate command no longer work? [closed]
I was experimenting with PyDictionary because I wanted to add a Define/Translate feature to my discord bot, but it only gives me {} as a response to print(dictionary.meaning("indentation")) ...
0
votes
0
answers
69
views
OpenCV not detecting unfilled circle outlines as bubbles in OMR sheet - what detection method works for both empty and filled bubbles?
I am building an OMR (Optical Mark Recognition) system in Python using OpenCV. My answer sheet has 180 bubbles arranged in 4 columns of 45 questions, with 4 options (A, B, C, D) per question. Each ...
1
vote
1
answer
50
views
session.run fails on a script containing comments, does it not strip comments?
I have a .dos script that runs fine in the DolphinDB GUI but fails when executed via the Python API's session.run. The error goes away when I manually remove all comments from the script.
Script (...
Tooling
0
votes
3
replies
54
views
What classification models are suitable for time series data?
I have a raw time series dataset. Can I use classification models on time series data? If yes which classification models can I use without forecasting? Most examples I’ve seen focus on forecasting or ...
Best practices
0
votes
12
replies
101
views
Series cancelations accumulate errors, how to avoid?
import math
import matplotlib.pyplot as plt
import numpy as np
m=50
def taylor_cos(x,n):
sum=0
for i in range(0, n):
sum=sum+ (((-1)**i) * (x**(2*i)) / math.factorial(2*i))
...