QuestionId int64 74.8M 79.8M | UserId int64 56 29.4M | QuestionTitle stringlengths 15 150 | QuestionBody stringlengths 40 40.3k | Tags stringlengths 8 101 | CreationDate stringdate 2022-12-10 09:42:47 2025-11-01 19:08:18 | AnswerCount int64 0 44 | UserExpertiseLevel int64 301 888k | UserDisplayName stringlengths 3 30 β |
|---|---|---|---|---|---|---|---|---|
79,626,166 | 219,153 | Why cv.convexityDefects fails in this example? Is it a bug? | <p>This script:</p>
<pre><code>import numpy as np, cv2 as cv
contour = np.array([[0, 0], [1, 0], [1, 1], [0.5, 0.2], [0, 0]], dtype='f4')
hull = cv.convexHull(contour, returnPoints=False)
defects = cv.convexityDefects(contour, hull)
</code></pre>
<p>fails and produces this error message:</p>
<pre><code> File "/h... | <python><opencv><convex-hull> | 2025-05-17 04:00:18 | 2 | 8,585 | Paul Jurczak |
79,626,027 | 8,674,852 | While installing numpy, `../meson.build:1:0: ERROR: Compiler cc cannot compile programs.` occured | <p>When I ran <code>pip install numpy==2.0.0</code> in my docker container, following error happened.</p>
<pre class="lang-bash prettyprint-override"><code># pip install numpy==2.0.0
Collecting numpy==2.0.0
Downloading numpy-2.0.0.tar.gz (18.3 MB)
ββββββββββββββββββββββββββββββββββββββββ 18.3/18.3 MB 35.3 MB/s e... | <python><numpy> | 2025-05-16 23:04:54 | 2 | 608 | siruku6 |
79,625,948 | 811,335 | Why some nested python functions are defined as `def _():` | <p>I understand internal functions are prefixed with '_' to indicate they are helper/internal functions. It also helps with tooling etc. But I find some functions with just '_' as their name. Can't even find where they are called from. e.g., from</p>
<p><a href="https://github.com/jax-ml/jax/blob/7412adec21c534f8e4bcc6... | <python><jax> | 2025-05-16 21:19:09 | 1 | 39,244 | A. K. |
79,625,827 | 16,563,251 | Type hint dict keys and values with matching generic type | <p>I have a class that behaves like a wrapper around some object.
The object will always be a subclass of some parent class, but otherwise it can be anything (to simplify, I assume this parent class is <code>object</code> in my example).
Therefore, I made the <code>Wrapper</code> class <a href="https://typing.python.or... | <python><python-typing> | 2025-05-16 19:31:33 | 0 | 573 | 502E532E |
79,625,826 | 10,569,563 | Django manage command set stdout and stderr | <p>Is there a way to set <code>stdout</code> and <code>stderr</code> from <code>base_stealth_options</code> in <code>BaseCommand</code> when running the django command? I can't find any documentation about how to use those options. For example, I would like to set <code>stdout</code> and <code>stderr</code> to a logger... | <python><django><stdout><stderr> | 2025-05-16 19:31:22 | 0 | 401 | Zuerst |
79,625,804 | 2,072,516 | Can't sort by field on joined table | <p>I have a model which I'm joining subsequently onto 3 other models:</p>
<pre><code> statement = select(Item).filter(Item.id == item_id)
if include_purchases:
statement = statement.options(
joinedload(Item.purchases)
.joinedload(Purchase.receipt)
... | <python><sqlalchemy> | 2025-05-16 19:15:21 | 1 | 3,210 | Rohit |
79,625,529 | 3,067,485 | Creating TabularInline in Django Admin View for inherited Many2Many relation | <p>I have a Tag Model and Mixin that is used for adding tags to entities whenever it is needed.</p>
<pre><code>class Tag(models.Model):
name = models.CharField(max_length=64, unique=True)
class TagMixin(models.Model):
class Meta:
abstract = True
tags = models.ManyToManyField(Tag, blank=True)
</co... | <python><django> | 2025-05-16 15:47:46 | 1 | 11,564 | jlandercy |
79,625,503 | 7,295,599 | How to correctly crop PDF with Python to bounding-box? | <p>There are a few similar posts here on SO, but they do not cover my issue.
I am using the following script to crop a PDF to its visible content.</p>
<pre><code>### crop a PDF to visible objects
import fitz # PyMuPDF
def crop_pdf_to_visible_content(input_pdf, output_pdf):
# Open the input PDF
doc = fitz.open... | <python><pdf><crop><bounding-box><pymupdf> | 2025-05-16 15:28:30 | 2 | 27,030 | theozh |
79,625,501 | 337,149 | Wrong encoding with Python decode in Windows command prompt | <p>When I run <em>decode</em> on a byte string encoded as UTF-8 I get ANSI encoding in a Windows command prompt.</p>
<pre><code>>python --version
Python 3.13.0
>python -c "print(b'\xc3\x96'.decode('utf-8'))" > test.txt
</code></pre>
<p>When I open test.txt in Notepad++ it says that the encoding is AN... | <python><windows><character-encoding><command-prompt> | 2025-05-16 15:27:15 | 2 | 11,423 | August Karlstrom |
79,625,500 | 3,161,801 | Entity.put error after Python 3 migration for Google Data Store - refactored | <p>I have the code below to update an entity in the Google data store.</p>
<p>I'm now getting an internal error on the <code>model.Collection.put(vhighest)</code></p>
<p>sync.yaml</p>
<pre><code>
service: sync
instance_class: F2
automatic_scaling:
max_instances: 1
runtime: python312
app_engine_apis: true
entrypoint: ... | <python><google-app-engine><google-cloud-datastore><ndb> | 2025-05-16 15:26:56 | 0 | 775 | ffejrekaburb |
79,625,465 | 1,200,914 | Is there an alternative to ask every n seconds to know if a celery task is done? | <p>I used Celery several times in the past and the idea I always had is that:</p>
<ul>
<li>You have a FastAPI, which delays tasks connecting to a broker</li>
<li>Celery gets the tasks, do them and then sends back the result to the broker.</li>
<li>In the fastAPI you have an endpoint to check using AsyncResult the resul... | <python><redis><celery><celery-task> | 2025-05-16 15:07:28 | 2 | 3,052 | Learning from masters |
79,625,439 | 15,915,737 | Get files from S3 with lambda | <p>I'm trying to retrieve files from an AWS S3 bucket using a Lambda function, but my script keeps timing out, and I can't figure out why.
<code>"errorMessage": "2025-05-16T14:37:13.093Z fdb6***4165 Task timed out after 30.03 seconds"</code></p>
<p>The code I'm using is a basic script I got from the... | <python><amazon-web-services><amazon-s3><aws-lambda><terraform-provider-aws> | 2025-05-16 14:51:10 | 1 | 418 | user15915737 |
79,625,371 | 1,878,545 | How do I save data of the following format to a file for a vision language model machine learning training job | <p>I have data of the following JSON format:</p>
<pre class="lang-py prettyprint-override"><code>from datasets import load_dataset
train_dataset, eval_dataset, test_dataset = load_dataset(
"HuggingFaceM4/ChartQA",
split=['train[:5%]', 'val[:5%]', 'test[:5%]']
)
</code></pre>
<pre class="lang-json pre... | <python> | 2025-05-16 14:17:01 | 0 | 1,725 | nathanielng |
79,625,347 | 5,568,409 | Best way to create a list of ticklabels by multiples of pi | <p>I am working on <code>Python 3x</code> and I have this list of integers:</p>
<pre><code>L = [0, 1, 2, 3, 4]
</code></pre>
<p>How could I from <code>L</code> create this list of tick labels:</p>
<pre><code>T = [0, \pi, 2\pi, 3\pi, 4\pi] ?
</code></pre>
<p>I have no idea and just tried:</p>
<pre><code>L = [0,1,2,3,4]... | <python><python-3.x><list> | 2025-05-16 14:07:40 | 1 | 1,216 | Andrew |
79,625,316 | 3,732,793 | Azure Management now showing size for search service index | <p>With is code I can get the number of documents in an azure search service index.</p>
<pre><code>credential = DefaultAzureCredential()
search_client = SearchClient(endpoint, index_name, credential)
document_count = search_client.get_document_count()
</code></pre>
<p>this</p>
<pre><code>index_stats = search_client.get... | <python><azure-cognitive-search> | 2025-05-16 13:45:44 | 2 | 1,990 | user3732793 |
79,625,291 | 2,091,953 | Running a script from /opt/ is failing with Docker mounts | <p>I have a Python script that creates <code>docker run</code> commands and executes them. This runs just fine from my <code>/home/myuser</code> directory, but if I move it to <code>/opt/myuser</code> (having to sudo run everything there), all of a sudden my docker run command can't find the mounted data. Specifically,... | <python><linux><docker><opt> | 2025-05-16 13:33:06 | 0 | 753 | mjswartz |
79,625,264 | 5,767,511 | How to find the latest version of a python package supported by currently installed packages | <p>I am working on a project with <code>packaging==21.3</code> specified in the <code>requirements.txt</code> file. I want to install black, but if I do so, it installs the latest version of black which depends on <code>packaging>=22.0</code>, so it updates packaging.</p>
<pre><code>$ pip install black
...
Collectin... | <python><pip> | 2025-05-16 13:18:41 | 1 | 553 | dylanmorroll |
79,625,228 | 12,184,608 | Type narrowing an element of tuple based on type of other element | <p>I am looking for a way to type hint a function that returns a tuple containing a success flag and, in the case of success, <code>None</code>, or, in the case of failure, an <code>Exception</code> instance. Declaring the function as returning <code>tuple[bool, Union[Exception, None]]</code> obviously doesn't work -- ... | <python><python-typing> | 2025-05-16 12:55:57 | 2 | 364 | couteau |
79,625,172 | 2,528,063 | Format number to at most n digits in python | <p>I know I can use <code>format</code> in order to format a number to whatever format. What I want is to format to <em>at most</em> n digts.</p>
<p>This can be achieved using the <code>g</code>-format-specifier. <em>But</em> there's one caveat here. What if my input is a really small number, e.g. <code>-0.0000000001</... | <python><rounding><number-formatting> | 2025-05-16 12:21:56 | 3 | 37,422 | MakePeaceGreatAgain |
79,624,532 | 13,933,721 | python series of No module named <module name> | <p>Consider this project tree:</p>
<pre><code>project
β
βββ app/
β
βββ main.py
βββ __init__.py
β
βββ common/
β βββ __init__.py
β βββ do_common.py
β
βββ util/
βββ __init__.py
βββ do_util.py
</code></pre>
<p>main.py</p>
<pre><code>import sys
from pathlib import Path... | <python> | 2025-05-16 05:30:43 | 1 | 1,047 | Mr. Kenneth |
79,624,324 | 6,141,238 | Is there a natural way to load the data of a sqlite3 table as a dictionary of lists rather than a list of dictionaries? | <p>The following table <code>my_table</code></p>
<pre><code>idx speed duration
0 420 50
1 380 40
2 390 45
</code></pre>
<p>is stored in a database file <code>my_db.db</code>. Loading this table as a list of dictionaries appears straightforward: the code</p>
<pre><code>conn = sqlit... | <python><database><list><sqlite><dictionary> | 2025-05-16 00:36:49 | 2 | 427 | SapereAude |
79,624,258 | 11,602,400 | ctypes + cgo and ownership of strings | <p><strong>Background</strong></p>
<p>I am currently using a DLL I generated with golang in python. As a sanity check for debugging I added a function called <code>return_string()</code>, which takes a pointer to a string in C (<code>char*</code>) converts to go, then returns the result. Mostly this is a debugging tool... | <python><go><ctypes><cgo> | 2025-05-15 22:34:06 | 1 | 1,481 | Kieran Wood |
79,624,041 | 21,370,869 | why is maya failing to import my python library and run a function defined within it | <p>My library is saved at</p>
<pre><code>C:\Users\user1\Documents\maya\scripts\test_lib.py
</code></pre>
<p>and its entire content is:</p>
<pre><code>def my_func():
print("hello world!")
</code></pre>
<p>When I run the following in the script editor, I get an error:</p>
<pre><code>import test_lib
my_func()... | <python><maya> | 2025-05-15 18:59:39 | 1 | 1,757 | Ralf_Reddings |
79,623,944 | 3,357,935 | How do I request and download a CSV of email activity from the SendGrid API? | <p>I want to get a CSV of email activity from the SendGrid v3 Email Activity API.</p>
<p>I tried to use the API to <a href="https://www.twilio.com/docs/sendgrid/api-reference/email-activity/request-a-csv" rel="nofollow noreferrer">request a CSV export of email activity</a>, like so:</p>
<pre class="lang-py prettyprint-... | <python><sendgrid><sendgrid-api-v3> | 2025-05-15 17:51:38 | 1 | 27,724 | Stevoisiak |
79,623,918 | 2,526,586 | Show description of each API endpoint method for Swagger doc with flask_restx | <p>I have something like this for my Flask app using <code>flask_restx</code>:</p>
<pre><code>from flask import Blueprint, request
from flask_restx import Api, Resource, Namespace
blueprint = Blueprint('location_api', __name__)
api = Api(blueprint)
ns = Namespace('location', description='Location update operations')
... | <python><flask><swagger><flask-restx> | 2025-05-15 17:27:24 | 1 | 1,342 | user2526586 |
79,623,848 | 16,462,878 | close or not close file descriptor in a function body? | <p>I found many many times a code like this</p>
<pre><code>def content(path):
return open(path).read()
</code></pre>
<p>I have met such construct typically by programmers coming from lower level languages such as C or C++.</p>
<p>More conventional constructs are instead the following:</p>
<pre><code>def content(pa... | <python><file-descriptor> | 2025-05-15 16:42:57 | 0 | 5,264 | cards |
79,623,815 | 3,486,684 | How can I automatically create a type annotation for a dataclass method based on the dataclass' members? | <p>Consider the following example:</p>
<pre class="lang-py prettyprint-override"><code>from dataclasses import dataclass
import dataclasses
from typing import Self
@dataclass
class Dataclass:
a: int
b: str
c: list[int]
def update_attrs(self, **kwargs) -> Self:
return self.__class__(**(data... | <python><python-typing><python-dataclasses> | 2025-05-15 16:17:14 | 0 | 4,654 | bzm3r |
79,623,779 | 4,444,757 | How can I pass the variable value to this string in python? | <p>I want to assign a variable to the stop loss and take profit in the following phrase. According to the <a href="https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Place%20order" rel="nofollow noreferrer">exchange documentation</a>, these values ββare constants as follows(for example: 102217.88):</p>
<pre... | <python><string><variables> | 2025-05-15 15:58:21 | 1 | 1,290 | Sadabadi |
79,623,688 | 12,881,307 | Subclassing Pandas DataFrame to obtain column names autocompletion in IDE | <p>I am working with Pandas DataFrames in <code>.py</code> files. I would like to have column name autocompletions in VSCode, similar to how it works with <code>.ipynb</code> files.</p>
<p>I remember reading I could subclass a <code>DataFrame</code> to achieve this. The post showed a code snippet similar to the followi... | <python><pandas><dataframe> | 2025-05-15 15:19:55 | 1 | 316 | Pollastre |
79,623,671 | 23,196,983 | Find the largest itemset in agroup of itemsets with the same support efficiently | <p>I have a spark-DataFrame with two columns, ID and Items. Items is a list of strings.</p>
<p>My goal is to find frequent subsets of the itemsets in my data. I am familiar with apriori and fp-growth and used the latter to find frequent subsets. But I have one more requirement, in cases where multiple itemsets along a ... | <python><algorithm><pyspark><data-mining><fpgrowth> | 2025-05-15 15:09:44 | 1 | 310 | Frede |
79,623,568 | 2,263,683 | How to export dependencies to requirement.txt and requirements-dev.txt using uv-pre-commit | <p>I'm using <code>uv</code> as my package manager in my Python project. My <code>pyproject.toml</code> file looks like this:</p>
<pre class="lang-toml prettyprint-override"><code>[project]
name = "some-name"
version = "0.1.0"
readme = "README.md"
requires-python = ">=3.11"
de... | <python><requirements.txt><pre-commit.com><uv> | 2025-05-15 14:22:36 | 1 | 15,775 | Ghasem |
79,623,523 | 7,692,855 | Add Column Names to retrieved data from pymysql | <p>I have a simple SQL command via pymsql to retrieve data</p>
<pre><code>db = pymysql.connect(
db=DATABASE,
passwd=DB_PASSWORD,
host=DB_HOST,
user=DB_USER,
)
cursor = db.cursor()
cursor.execute("""
select flight, aircraft_model
from flights
where flights.aircraft_type in ('bo... | <python><pymysql> | 2025-05-15 14:01:58 | 1 | 1,472 | user7692855 |
79,623,319 | 2,410,605 | Locate link that is not an anchor and does not have unique identifiers other than text | <p>I have to log into a website and navigate to a specific link. The content on the site is dynamic and tends to move, so I don't really trust using an XPath. Also, the link is not in an anchor, does not have an ID, and has a generic class. As best as I can tell the only thing I can trust is the text field:</p>
<pre ... | <python><selenium-webdriver> | 2025-05-15 12:24:55 | 1 | 657 | JimmyG |
79,623,174 | 7,321,700 | Calculating a pct_change between 3 values in a pandas series, where one of more of these values can be nan | <p><strong>Scenario:</strong> I have a pandas series that contains 3 values. These values can vary between nan, 0 and any value above zero. I am trying to get the pct_change among the series whenever possible.</p>
<p><strong>Examples:</strong></p>
<pre><code>[0,nan,50]
[0,0,0]
[0,0,50]
[nan,nan,50]
[nan,nan,0]
[0,0,nan... | <python><pandas> | 2025-05-15 11:03:30 | 1 | 1,711 | DGMS89 |
79,623,173 | 12,013,353 | Can you change the default tick density when creating a matplotlib plot? | <p>When you create a plot with <code>matplotlib.pyplot</code> (<code>plt</code>), and call the grid with <code>plt.grid()</code>, from what I understand a call is made to <code>plt.Locator</code> class. I was wondering if there is a simple way, through some parameter, that changes the default behaviour to always make t... | <python><matplotlib><xticks> | 2025-05-15 11:03:22 | 1 | 364 | Sjotroll |
79,622,860 | 8,831,116 | How to import submodules under tests/ and still run only tests in subdirectory in Python | <p>I have a the following test folder layout:</p>
<pre><code>tests
βββ __init__.py
βββ conftest.py
βββ data_validation
β βββ test_data_validation.py
βββ per_vendor
βββ __init__.py
βββ vendor_a
β βββ conftest.py
β βββ test_vendor_a.py
βββ vendor_b
βββ __init__.py
βββ conftest.py... | <python><pytest> | 2025-05-15 07:59:18 | 1 | 858 | Max GΓΆrner |
79,622,744 | 12,415,855 | Can not find shadow-root using selenium? | <p>i try to find a shadow root on a website and clicking a button using the following code:</p>
<pre><code>import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
from s... | <python><selenium-webdriver><shadow-root> | 2025-05-15 06:31:41 | 4 | 1,515 | Rapid1898 |
79,622,730 | 6,930,340 | Split an array in a polars dataframe into regular columns | <p>I have a <code>pl.DataFrame</code> with an array column. I need to split the array columns into traditional columns while assigning headers at the same time.</p>
<pre><code>import polars as pl
df = pl.DataFrame(
{
"first_last": [
["Anne", "Adams"],
[... | <python><dataframe><python-polars><polars> | 2025-05-15 06:20:15 | 1 | 5,167 | Andi |
79,622,589 | 3,161,801 | NDB Python Error returning object has no attribute 'connection_from_host' | <p>I have the code below which is built on top of ndb.</p>
<p>When running I receive the two errors below.</p>
<p>Can I ask for some guidance, specifically what is the <code>connection_from_host</code> referring to?</p>
<pre><code>import flask
import config
import util
app = flask.Flask(__name__)
from google.appengi... | <python><google-app-engine><ndb> | 2025-05-15 03:55:50 | 1 | 775 | ffejrekaburb |
79,622,553 | 2,278,546 | nodriver crashes with infinite recursion in headless mode when running browser.get() | <p>Here is the code I'm trying to run:</p>
<pre><code>import nodriver as uc
async def main():
browser = await uc.start(headless=True)
page = await browser.get('https://www.nowsecure.nl')
if __name__ == '__main__':
uc.loop().run_until_complete(main())
</code></pre>
<p>Here is the output I get in the termi... | <python><web-scraping><nodriver> | 2025-05-15 03:05:50 | 2 | 505 | grasswistle |
79,622,539 | 7,419,457 | mupdf mark field form widgets as read only | <p>What I am trying to do is update form fields in a PDF with a value and then mark them as read-only so that they cannot be further edited.</p>
<p>I have tried two approaches.
use</p>
<pre><code>pdf.bake()
</code></pre>
<p>This did not work for my use case, as post filling in data in the PDF I am doing an e-signature ... | <python><pdf><pymupdf><mupdf> | 2025-05-15 02:48:48 | 2 | 977 | Rahul |
79,622,523 | 21,370,869 | Struggling to provide a correct value to 'OpenMaya.MItMeshPolygon.center()' | <p>Am taking first steps into the Open Maya API, the Python version. I've gone through a <a href="https://zurbrigg.teachable.com/p/maya-python-api-vol-1" rel="nofollow noreferrer">Maya API</a> series, and did some tasks such as printing to the script editor. I am now trying to write my own small bits of code. In this ... | <python><maya><maya-api> | 2025-05-15 02:12:29 | 1 | 1,757 | Ralf_Reddings |
79,622,504 | 154,048 | How to limit the length of or suppress local variables in structlog exception reports? | <p>I'm using structlog in an application. When I use it to render an exception:</p>
<pre><code>logger = structlog.get_logger()
logger.exception("boom")
</code></pre>
<p>I get the expected pretty exception report. However there are some local variables in that context which are very large. They make the except... | <python><exception><structlog> | 2025-05-15 01:40:43 | 1 | 1,166 | Peter Loron |
79,622,434 | 14,122 | Unable to create a nested DefaultDict in a pydantic BaseModel | <p>Consider:</p>
<pre><code>#!/usr/bin/env -S uv run --script
# /// script
# dependencies = [ "pydantic>=2.10.5,<3" ]
# requires-python = ">=3.12,<3.13"
# ///
import pydantic
from typing import Annotated
from collections import defaultdict
from uuid import UUID
class Repro(pydantic.Ba... | <python><pydantic> | 2025-05-14 23:57:41 | 1 | 299,045 | Charles Duffy |
79,622,266 | 10,727,283 | Explicitly declared protocol on child fails with "Protocols cannot be instantiated" | <p>Please help me understand why this code fails.</p>
<pre class="lang-py prettyprint-override"><code>from typing import Protocol
class Base:
pass
class MyProto(Protocol):
def hello(self) -> None:
pass
class Child(Base, MyProto):
def __init__(self) -> None:
super().__init__() # Typ... | <python><python-3.9> | 2025-05-14 20:48:40 | 1 | 1,004 | Noam-N |
79,622,206 | 219,153 | Can you explain values of imgIdx and trainIdx in this example of cv.match? | <p>This OpenCV Python script:</p>
<pre><code>import numpy as np, cv2 as cv
bf = cv.BFMatcher(cv.NORM_L1, crossCheck=False)
bf.add(np.array([[0], [1], [2]], dtype='f4')) # train image 0
bf.add(np.array([[0.1], [1.1], [2.1]], dtype='f4')) # train image 1
bf.train()
src = np.array([[0], [1.1], [2.1]], dtype='f4')
matc... | <python><opencv> | 2025-05-14 20:09:10 | 1 | 8,585 | Paul Jurczak |
79,622,141 | 364,696 | Is there a reason not to replace the default logging.Handler lock with a multiprocessing.RLock to synchronize multiprocess logging | <p>I've got some code that, for reasons not germane to the problem at hand:</p>
<ol>
<li>Must write <em>very</em> large log messages</li>
<li>Must write them from multiple <code>multiprocessing</code> worker processes</li>
<li>Must not interleave the logs at all</li>
</ol>
<p>Performance of logging is a secondary consi... | <python><multiprocessing><python-multiprocessing><mutex><python-logging> | 2025-05-14 19:18:05 | 0 | 157,585 | ShadowRanger |
79,622,114 | 3,357,935 | How do I get a list of Single Send campaign names from the Sendgrid API? | <p>I want to use the <a href="https://www.twilio.com/docs/sendgrid/api-reference" rel="nofollow noreferrer">SendGrid v3 API</a> to retrieve a list of all my Single Send campaigns and their names.</p>
<p>According to the SendGrid API documentation, I can retrieve statistics for all my Single Sends by sending a GET reque... | <python><python-3.x><twilio><sendgrid><sendgrid-api-v3> | 2025-05-14 18:49:56 | 1 | 27,724 | Stevoisiak |
79,621,934 | 3,125,823 | Specific permissions for different types of users with django rest framework model and view | <p>I'm using DRF's ModelViewSet for my views and DefaultRouter to create the urls.</p>
<p>This particular model creates a feature that only admins have full CRUD access.</p>
<p>Authenticated users should have READONLY and Delete permissions. And Anonymous users should only have READONLY access.</p>
<p>I'm pretty sure t... | <python><django-models><django-rest-framework><django-views><permissions> | 2025-05-14 16:43:15 | 1 | 1,958 | user3125823 |
79,621,875 | 2,343,309 | Cython *.pxd file cannot use absolute imports for Cython submodule | <p>I am getting an <code>Error compiling Cython file</code>, 'myproject/utils/hdf5.pxd' not found` when trying to build my Cython project in a certain way.</p>
<p>My Cython project is organized this way:</p>
<pre><code>myproject/
setup.cfg
setup.py <-- For installing the Python project
myproject/
__... | <python><cython><distutils> | 2025-05-14 16:09:38 | 1 | 376 | Arthur |
79,621,854 | 2,287,458 | Compute cumulative mean & std on polars dataframe (using over) | <p>I want to compute the cumulative mean & std on a polars dataframe column.</p>
<p>For the <code>mean</code> I tried this:</p>
<pre class="lang-py prettyprint-override"><code>import polars as pl
df = pl.DataFrame({
'value': [4, 6, 8, 11, 5, 6, 8, 15],
'class': ['A', 'A', 'B', 'A', 'B', 'A', 'B', 'B']
})
... | <python><python-3.x><python-polars><cumulative-sum> | 2025-05-14 15:53:28 | 2 | 3,591 | Phil-ZXX |
79,621,805 | 662,285 | azure.core.exceptions.HttpResponseError: (None) Internal server error 500 - model response from Azure AI foundry | <p>I have Azure AI foundry hub which has private end point enabled and all other network is disabled on it. I also have Azure AI Project under hub which is used to deploy serverless endpoint model.
When i use AzureKeyCredential("key") it works fine but when i use DefaultAzureCredential() it gives me error In... | <python><azure><azure-machine-learning-service><azure-ai-foundry> | 2025-05-14 15:20:50 | 1 | 4,564 | Bokambo |
79,621,538 | 130,948 | Error in while running Jupyter Notebook connecting to Azure PostgreSQL database with Entra Auth | <p>I am new to Jupyter Notebook and running fundamental code to connect to the Azure PostgreSQL database. To my understanding, the connection is successful but somehow it's not able to parse the output but I'm not 100% sure on this.</p>
<pre><code>from azure.identity import DefaultAzureCredential
username = "user... | <python><postgresql><azure><pip><prettytable> | 2025-05-14 13:02:39 | 0 | 743 | Ravi Khambhati |
79,621,480 | 13,443,954 | How to locate custom elements of pdftron in DOM | <p>our dev team working with apryse pdftron (angular) and using custom elements on the loaded document, like checkbox, textbox - which you can drag-and-drop into the webviewer.
My problem is, that these elements are not exist in the DOM at all - so I cannot locate them for automation test.
The pdf is under an opened sh... | <python><angular><dom><pdftron> | 2025-05-14 12:32:39 | 0 | 333 | M AndrΓ‘s |
79,621,448 | 3,760,519 | How do I show a formatted html table in python, during an interactive programming session? | <p>Essentially, I am looking for a python equivalent of the R behaviour when I use packages such as <a href="https://gt.rstudio.com/" rel="nofollow noreferrer">GT</a> or <a href="https://rstudio.github.io/DT/" rel="nofollow noreferrer">DT</a>. When "print" the objects generated by these packages, I can see th... | <python><dataframe> | 2025-05-14 12:18:08 | 1 | 2,406 | Chechy Levas |
79,621,191 | 29,430,839 | Issue in scraping data | <p>I have an issue in scraping schools data. I need their email and website URL. I tried a lot but it's returning empty results.</p>
<p>What's the best way to do this?</p>
<p>Here is the code:</p>
<pre><code>from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.com... | <python><selenium-webdriver><web-scraping> | 2025-05-14 09:50:12 | 1 | 2,155 | Omprakash S |
79,621,152 | 1,764,129 | Multiple line figure without new coloring in Altair | <p>The basic example of multiple lines in Altair shows distinct lines in a different color:</p>
<pre><code>import altair as alt
from vega_datasets import data
source = data.stocks()
alt.Chart(source).mark_line().encode(
x='date:T',
y='price:Q',
color='symbol:N',
)
</code></pre>
<p>How does one make this s... | <python><altair> | 2025-05-14 09:33:45 | 1 | 4,935 | p-robot |
79,621,149 | 393,010 | only change type annotation of method in subclass | <p>Is it possible to change/"override" the return type of a method in a subclass without overriding/altering the method (implementation) itself? Something like:</p>
<pre class="lang-py prettyprint-override"><code>class Foo:
def gimme_thing() -> Thing:
return self.factory.create()
class Bar(Foo... | <python><python-typing> | 2025-05-14 09:33:01 | 3 | 5,626 | Moberg |
79,620,845 | 14,245,686 | How is np.repeat so fast? | <p>I am implementing the Poisson bootstrap in Rust and wanted to benchmark my repeat function against numpy's. Briefly, <code>repeat</code> takes in two arguments, data and weight, and repeats each element of data by the weight, e.g. [1, 2, 3], [1, 2, 0] -> [1, 2, 2]. My naive version was around 4.5x slower than <co... | <python><arrays><numpy><rust> | 2025-05-14 06:34:04 | 1 | 482 | stressed |
79,620,649 | 3,026,965 | Configuring external user-defined module for multiple scripts in python | <p>I am running several python scripts (one at a time) to manipulate photo, video, and audio files in different combinations in the CWD.</p>
<p>Instead of specifying in each script's body the dozens of "foto_files", for example, what is the best way to call that information from an external user-defined modul... | <python><dictionary><module><lookup> | 2025-05-14 02:39:19 | 1 | 727 | user3026965 |
79,620,550 | 1,380,285 | Python global variable changes depending on how script is run | <p>I have a short example python script that I'm calling glbltest.py:</p>
<pre><code>a = []
def fun():
global a
a = [20,30,40]
print("before ",a)
fun()
print("after ",a)
</code></pre>
<p>If I run it from the command line, I get what I expect:</p>
<pre><code>$ python glbltest.py
before []
a... | <python><global-variables> | 2025-05-13 23:51:32 | 1 | 6,713 | bob.sacamento |
79,620,339 | 1,305,287 | Clearing clipboard on program exit in python Tk and Kubuntu | <p>Python 3.12 in a venv, Kubuntu 24.04.02.</p>
<p>I'm using the tkinter clipboard in a python program to hold a small amount of text, to ctrl-V into text editors and browser fields. This bit works fine.</p>
<p><strong>I would now like the clipboard to be set to a defined value on program exit.</strong> Empty would be ... | <python><tkinter><clipboard> | 2025-05-13 19:47:19 | 2 | 1,103 | Neil_UK |
79,620,333 | 2,648,504 | Insert new column (of blanks) into an existing dataframe | <p>I have an existing dataframe:</p>
<pre><code>data = [[5011025, 234], [5012025, 937], [5013025, 625]]
df = pd.DataFrame(data)
</code></pre>
<p>output:</p>
<pre><code> 0 1
0 5011025 234
1 5012025 937
2 5013025 625
</code></pre>
<p>What I need to do is insert a new column at <code>0</code> (the same # ... | <python><pandas> | 2025-05-13 19:42:50 | 1 | 881 | yodish |
79,620,274 | 8,119,509 | Integrating Spiceai MCP with Slack Bot | <p>I followed the <a href="https://spiceai.org/docs/installation" rel="nofollow noreferrer">Spice.ai documentation</a> and the getting started guide to use Spice MCP with OpenAI. Now, I am trying to use it with a Slack bot, but I keep getting 404 errors or "method not found" errors. I believe this might be du... | <python><model-context-protocol><slack-bot> | 2025-05-13 18:59:43 | 0 | 403 | Ritesh Kankonkar |
79,619,949 | 5,944,880 | ffmpeg how to set max_num_reorder_frames H264 | <p>Anyone know how can I set max_num_reorder_frames to 0 when I am encoding H264 video ?
You can find in the <a href="https://ffmpeg.org/doxygen/4.0/structH264RawVUI.html#ad5f9d8d1aac32a586542e2d133d7aae8" rel="nofollow noreferrer">docs</a> as <code>uint8_t H264RawVUI::bitstream_restriction_flag</code></p>
<p>PS. Based... | <python><ffmpeg><h.264><pyav> | 2025-05-13 15:14:03 | 1 | 417 | Vasil Yordanov |
79,619,885 | 4,050,510 | How can I convert a Sequence(Image) to an Array4D without going through Seqence(Sequence(Sequence(Sequence()))? | <p>I have a huggingface dataset with a column <code>ImageData</code> that has the featuredescriptor <code>s.features={'images': Sequence(feature=Image(mode=None, decode=True, id=None), length=16, id=None)}</code>.</p>
<p>I need to convert this into a torch 4D tensor (all images are RGB and have same shape). It is possi... | <python><arrays><huggingface-datasets> | 2025-05-13 14:36:22 | 1 | 4,934 | LudvigH |
79,619,717 | 8,477,566 | How to count consecutive increases in a 1d array | <ul>
<li>I have a 1d <code>numpy</code> array</li>
<li>It's mostly decreasing, but it increases in a few places</li>
<li>I'm interested in the places where it increases in several consecutive elements, and how many consecutive elements it increases for in each case</li>
<li>In other words, I'm interested in the <em>len... | <python><arrays><numpy><cumsum> | 2025-05-13 13:08:50 | 4 | 1,950 | Jake Levi |
79,619,552 | 11,350,845 | Get the canonical timezone name of a backward linked timezone in python? | <p>As title said, I'm looking for a simple way to get the canonical name of a timezone when providing a timezone name.</p>
<p>For example <code>Asia/Calcutta</code> is the backward liked name of <code>Asia/Kolkata</code>.</p>
<p>I'd expect <code>ZoneInfo("Asia/Calcutta").key</code> to be <code>Asia/Kolkata</c... | <python><python-3.x><timezone><zoneinfo><tzdata> | 2025-05-13 11:31:06 | 1 | 382 | Junn Sorran |
79,619,504 | 6,231,383 | Keep the '+' in URL in python | <p>I have an input which is a decoded URL and can contain incorrectly escaped '+' symbols, such as <code>'http://example.com/path/tofile?query=param+with+questionmark'</code>, where '+' symbols should be converted to %2B.
Here is my code to encode the url safely.</p>
<pre class="lang-py prettyprint-override"><code># Sa... | <python><url><urllib><urlencode> | 2025-05-13 10:48:29 | 1 | 2,191 | Prithvi Raj |
79,619,420 | 2,526,586 | Enabling Daylight saving adjustment for Flask-APScheduler | <p>I am trying to run APScheduler for my Flask app, but I can't get daylight saving time working for the cron time.</p>
<p>In my <code>app.py</code>, I have something like this:</p>
<pre><code>from flask import Flask
import pytz
from .scheduled_jobs import ScheduledJobs
class SchedulerAppConfig:
SCHEDULER_TIMEZONE... | <python><flask><dst><apscheduler> | 2025-05-13 09:54:14 | 1 | 1,342 | user2526586 |
79,619,273 | 6,017,822 | How do determine inner border points of polygon intersection | <p>I am trying to write a Python script that will return me all vertice locations (x,y) of inner intersecting edge between a square tile and a closed polygon with n-vertices. I got this far with my code, but am getting wrong inner border vertices. Is there an algorithm of somekind specificaly to determine inside edges,... | <python><geometry><clipping> | 2025-05-13 08:39:18 | 0 | 313 | tomazj |
79,619,068 | 7,500,106 | Unable to fetch user list from google workspace due to: Resource Not Found: userKey | <p>I was trying to fetch the user list using the below approach:</p>
<pre><code>def getGsuiteUserData(self, data):
access_token = data.get('access_token')
if not access_token:
raise Exception("access token is required.")
headers = {
'Authorization': f'Bearer {access_token}'
... | <python><google-cloud-platform><google-workspace> | 2025-05-13 06:30:57 | 0 | 664 | Utkarsh |
79,619,061 | 11,769,133 | Replacing values in columns with values from another columns according to mapping | <p>I have this kind of dataframe:</p>
<pre class="lang-py prettyprint-override"><code>df = pd.DataFrame({
"A1": [1, 11, 111],
"A2": [2, 22, 222],
"A3": [3, 33, 333],
"A4": [4, 44, 444],
"A5": [5, 55, 555]
})
A1 A2 A3 A4 A5
0 1 2 3 4 ... | <python><pandas> | 2025-05-13 06:28:18 | 2 | 1,142 | Milos Stojanovic |
79,618,963 | 13,933,721 | python .env inconsistent result | <p>.env</p>
<pre><code>ENDPOINT="http://localhost:9000"
</code></pre>
<p>py file</p>
<pre><code>import os
from urllib.parse import unquote
from dotenv import load_dotenv
load_dotenv()
endpoint = os.getenv("ENDPOINT", "")
print(endpoint)
# OR
endpoint = unquote(os.getenv("ENDPOINT&q... | <python><python-3.x><.env> | 2025-05-13 04:54:45 | 2 | 1,047 | Mr. Kenneth |
79,618,918 | 983,556 | using blender as a python module with pylance | <p>I'm trying to set up VSCode with Pylance and bpy for the purpose of making a Blender plugin, since I have very little knowledge of Python I think LSP support would help quite a bit.</p>
<p>I have cloned blender's git repo and ran <code>make update</code> and <code>make bpy</code> and gotten a bpy directory containin... | <python><visual-studio-code><blender><pylance><bpy> | 2025-05-13 03:59:25 | 0 | 1,700 | David Carpenter |
79,618,903 | 19,546,216 | Is this folder structure possible in Behave Selenium? | <p>I'm currently refactoring our code and our organization wants to combine different repositories into 1 and now I'm arranging the folder structure.</p>
<pre><code>DIRECTORY STRUCTURE:
+-- main_repository/
+-- other_dev_folders/
+-- testing/
+-- another_folder_layer/
+-- features/
... | <python><selenium-webdriver><bdd><python-behave> | 2025-05-13 03:38:11 | 1 | 321 | Faith Berroya |
79,618,851 | 2,817,520 | Uvicorn workers greater than one apparently reduce performance by half | <p><strong>Update 2:</strong> The following results do not hold when installing Uvicorn using <code>pip install uvicorn[standard]</code> which installs Uvicorn with Cython-based dependencies (where possible) and other optional extras.</p>
<p><strong>Update 1:</strong> I tested the app using <a href="https://hypercorn.r... | <python><fastapi><uvicorn><starlette> | 2025-05-13 02:21:05 | 0 | 860 | Dante |
79,618,567 | 3,806,728 | How to Cache Elements to increase the Runtime Performance with lxml Pythin Library | <p>In the lxml.de website <a href="https://lxml.de/performance.html" rel="nofollow noreferrer">https://lxml.de/performance.html</a>
I see the following statement:</p>
<p>A way to improve the normal attribute access time is static instantiation of the Python objects, thus trading memory for speed. Just create a cache di... | <python><lxml> | 2025-05-12 20:05:19 | 1 | 353 | user3806728 |
79,618,401 | 3,890,560 | Tensorflow: XLA compilation requires a fixed tensor list size | <p>I'm running Ubuntu on a laptop with a dGPU.</p>
<p>I installed tensorflow using docker: <code>docker pull tensorflow/tensorflow:latest</code>.
Tensorflow (2.19.0) can use a XLA CPU and a GPU.</p>
<p>I'm following this tutorial: <a href="https://www.tensorflow.org/tutorials/load_data/video" rel="nofollow noreferrer">... | <python><tensorflow2.0><tensorflow-xla> | 2025-05-12 17:49:05 | 0 | 599 | fghoussen |
79,618,176 | 307,050 | Matplotlib plot continuous time series of data | <p>I'm trying to continuously plot data received via network using matplotlib.</p>
<p>On the y-axis, I want to plot a particular entity, while the x-axis is the current time.</p>
<p>The x-axis should cover a fixed period of time, ending with the current time.</p>
<p>Here's my current test code, which simulates the data... | <python><numpy><matplotlib> | 2025-05-12 15:30:49 | 1 | 1,347 | mefiX |
79,617,933 | 24,271,353 | multidimensional coordinate transform with xarray | <p>How to convert multidimensional coordinate to standard coordinate in order to unify data when using <code>xarray</code> for nc data:</p>
<pre class="lang-py prettyprint-override"><code>import xarray as xr
da = xr.DataArray(
[[0, 1], [2, 3]],
coords={
"lon": (["ny", "nx"... | <python><python-xarray> | 2025-05-12 13:26:06 | 1 | 586 | Breeze |
79,617,815 | 865,169 | Can I be sure of the order requests are sent in in a Python requests session? | <p>I am using Python requests to communicate with an external API. When I do something like:</p>
<pre><code>with requests.Session() as sess:
resp1 = sess.put(
api_url + f"stuff/{id}/endpoint1",
json=contents1,
)
resp2 = sess.put(
api_url + f"things/{id}/endpoint2"... | <python><python-requests> | 2025-05-12 12:15:23 | 1 | 1,372 | Thomas Arildsen |
79,617,790 | 1,552,080 | Creating a Polars DataFrame from list of dicts? | <p>I want to create a Polars DataFrame or LazyFrame (I'm not sure what is appropriate) from a list of dictionaries where each of the dicts represents one row of data. Each individual dict has fields of various data types and most importantly some fields have array-like data. The array-like data related to on key can va... | <python><dataframe><python-polars> | 2025-05-12 11:55:40 | 1 | 1,193 | WolfiG |
79,617,641 | 617,603 | ./manage.py runserver on mac | <p>I'm setting up a new dev environment for Django development on a mac as a new Python dev but I'm receiving an error running a basic django app so I think my python setup is incorrect</p>
<p>I have <code>python3</code> installed so to make it easy to access, in my <code>.zshrc</code> I have added the line</p>
<pre cl... | <python><django><django-ninja> | 2025-05-12 10:27:03 | 1 | 668 | overbyte |
79,617,460 | 2,902,280 | What happens when you call a matplotlib continuous colormap with value outside of the (0, 1) range? | <p>The classical usage for a continuous colorbar such as viridis is to use <code>cm(val)</code> with <code>val</code> bewteen 0 and 1.</p>
<p>I can't figure out what's returned when you call it with an argument outside of the (0, 1) range, i.e. I'd expect to get the value corresponding to 1, but it's not the case:</p>
... | <python><matplotlib><colormap> | 2025-05-12 08:24:47 | 1 | 13,258 | P. Camilleri |
79,617,158 | 1,299,026 | Data access object not finding self attributes | <p>I have a data access object in Python/SQLite3 defined as:</p>
<pre><code>import sqlite3
class Dao:
VEHICLE_TABLE_SCHEMA = """
CREATE TABLE IF NOT EXISTS vehicles (
vehicle_key integer NOT NULL PRIMARY KEY AUTOINCREMENT,
vehic... | <python><python-3.x> | 2025-05-12 03:48:23 | 1 | 3,054 | Todd |
79,617,120 | 1,942,868 | Orderby and distinct at the same time | <p>I have tabels like this</p>
<pre><code>id sku
1 C
2 B
3 C
4 A
</code></pre>
<p>Finally I want to get the raws like this.</p>
<pre><code>1 C
2 B
4 A
</code></pre>
<p>At first I use <code>distinct</code></p>
<pre><code> queryset = self.filter_queryset(queryset.order_by('sku').distinct('sku'))
</code></pre>
<p>It ... | <python><django><postgresql> | 2025-05-12 02:43:27 | 1 | 12,599 | whitebear |
79,617,100 | 1,440,565 | Simple typer script gives TypeError | <p>I think typer 0.15.3 (maybe earlier) is broken. I don't make this claim lightly. But if I create a very basic script, I get an error:</p>
<p>pyproject.toml:</p>
<pre><code>[project]
name = "typer-example"
version = "0.1.0"
description = "Add your description here"
readme = "README.... | <python><typer> | 2025-05-12 02:18:31 | 2 | 83,954 | Code-Apprentice |
79,617,084 | 654,019 | creating Docker image for Buildozer on WSL (Ubuntu 22.04) fail | <p>I am trying to build Docker image for <a href="https://buildozer.readthedocs.io/" rel="nofollow noreferrer">Buildozer</a> as explained here: <a href="https://github.com/kivy/buildozer/tree/master?tab=readme-ov-file" rel="nofollow noreferrer">https://github.com/kivy/buildozer/tree/master?tab=readme-ov-file</a></p>
<p... | <python><docker><ubuntu><kivy><buildozer> | 2025-05-12 01:50:12 | 0 | 18,400 | mans |
79,616,857 | 3,138,436 | desired frequency in discrete fourier transform gets shifted by the factor of increasing sample duration | <p>I have written a python script to compute DFT of a simple sin wave having frequency 3. I have taken the following consideration for taking sample of the sin wave</p>
<p><strong>sin function for test = sin( 2 * pi * 3 * t )</strong></p>
<p><strong>sample_rate = 15</strong></p>
<p><strong>time interval = 1/sample_rate... | <python><signal-processing><sage><discretization> | 2025-05-11 19:47:54 | 2 | 9,194 | AL-zami |
79,616,804 | 4,075,135 | TypeVar as dict key type hint "has no meaning in this context" | <h1><strong>The context:</strong></h1>
<p>I have a dict whose keys are arbitrary types, and whose values are Callables which take a string and return an instance of the same type as the key. For example:</p>
<pre class="lang-py prettyprint-override"><code>class Hero:
def __init__(self, name):
self.name = na... | <python><python-typing><pyright> | 2025-05-11 18:35:56 | 2 | 721 | ZachP |
79,616,782 | 1,145,760 | How to denote return type of a @classmethod ctor in python? | <pre><code>#!/usr/bin/env python
# In this file: a problem with de-serializing an object.
import pickle
class User:
@classmethod
def from_bytes(cls, b: bytes) -> User:
obj = pickle.loads(b)
assert type(obj) == cls, (type(obj), cls)
return obj
</code></pre>
<p>fails with</p>
<pre><c... | <python><python-typing> | 2025-05-11 18:14:42 | 1 | 9,246 | Vorac |
79,616,634 | 2,583,346 | converting jupyter notebook (.ipynb) with to HTML using nbconvert - plotly figures not showing | <p>I have the following code in a notebook cell:</p>
<pre><code>import plotly.express as px
fig = px.scatter(x=[1,2,3], y=[1,2,3])
fig.show()
</code></pre>
<p>and I'm trying to convert it to HTML, like this:</p>
<pre><code>jupyter nbconvert --to html --execute try.ipynb
</code></pre>
<p>The HTML I get does not display... | <python><jupyter-notebook><plotly><jupyter><nbconvert> | 2025-05-11 15:27:43 | 2 | 1,278 | soungalo |
79,616,351 | 5,783,373 | Facing issue using a model hosted on HuggingFace Server and talking to it using API_KEY | <p>I am trying to create a simple langchain app on text-generation using API to communicate with models on HuggingFace servers.</p>
<p>I created a β.envβ file and stored by KEY in the variable: βHUGGINGFACEHUB_API_TOKENβ
I also checked it, API token is valid.</p>
<p>Post that, I tried running this code snippet:</p>
<pr... | <python><langchain><huggingface><huggingface-hub> | 2025-05-11 09:34:46 | 2 | 345 | Sri2110 |
79,616,310 | 20,589,631 | Firebase admin taking an infinite time to work | <p>I recently started using firebase admin in python. I created this example script:</p>
<pre class="lang-py prettyprint-override"><code>import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
cred = credentials.Certificate("./services.json")
options = {
"da... | <python><firebase><google-cloud-firestore><firebase-admin> | 2025-05-11 08:51:55 | 1 | 391 | ori raisfeld |
79,616,267 | 3,406,207 | ModuleNotFoundError: No module named 'itk' | <p>On Apple M3, Sequoia 15.4.1:
I am trying to run a python script on jupyter notebook, which is requiring the package 'itk':</p>
<pre><code>import itk
ModuleNotFoundError: No module named 'itk'
</code></pre>
<p>I have installed 'itk' but somehow the system cannot seem to find it?</p>
<pre><code>!python3 --version
Pyth... | <python><macos><jupyter-notebook><itk> | 2025-05-11 07:50:27 | 3 | 345 | user3406207 |
79,616,249 | 10,470,463 | How to suppress html table cell overflow when merging cells using rowspan? | <p>Using Python, I generated the html for a table. The table is a teacher timetable.</p>
<p>The data comes from a <code>.csv</code>, looks like this for the first and second row:</p>
<pre><code>Start period,Course,Lesson number,Day,Start time,End time,Instructor,Day number,Number of periods
1,CHEM1250,L01,Monday,8:00,9... | <python><html> | 2025-05-11 07:12:58 | 0 | 511 | Pedroski |
79,616,129 | 3,138,436 | One frequency is absent from fourier transform representation of the addition of two cosine wave of same amplitude and phase | <p>I have wrote a general python code in Sage-math to find out the Fourier transform of the addition of two different frequency cosine wave in order to plot the frequency domain in a graph. The function :</p>
<pre><code> f(t) = cos(2*pi*f1*t)+cos(2*pi*f2*t) # integrate it from -infinity to +infinity
</code></pre>
<p>... | <python><numpy><signal-processing><sage> | 2025-05-11 03:24:33 | 2 | 9,194 | AL-zami |
79,615,990 | 5,339,264 | How to concatenate n rows of content, to current row, in a rolling window, in pandas? | <p>I'm looking to transform a dataframe containing</p>
<p><code>[[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]</code></p>
<p>into <code>[[1, 2, 3, []], [4, 5, 6, [1, 2, 3, 4, 5, 6]], [7, 8, 9, [4, 5, 6, 7, 8, 9]], [10, 11, 12, [7, 8, 9, 10, 11, 12]]]</code></p>
<p>So far the only working solution I've come up with is:... | <python><pandas> | 2025-05-10 22:35:10 | 4 | 530 | Pebermynte Lars |
79,615,912 | 15,029,316 | Unexpected error: No such file or directory: 'ffprobe', while using pydub in Digital Ocean | <p>I have an app that processes audio files and converts them to 'wav' format. This works locally on my Mac, however in DigitalOcean, when recording audio, i get the below error, followed by a 500:</p>
<p><code>warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)<... | <python><ffmpeg><digital-ocean><pydub><audiosegment> | 2025-05-10 20:54:10 | 1 | 329 | Cjmaret |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.