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,301,627 | 1,473,517 | How to use Symbolic Regression to approximate Pascal's triangle? | <p>I have been trying out symbolic regression and was wondering how to use it approximate a row of Pascal's triangle for example. I make the data with:</p>
<pre><code>import math
def print_pascals_triangle_row(n):
row = []
for k in range(n + 1):
coefficient = math.comb(n, k)
row.append(coeffici... | <python><math><regression> | 2024-12-22 19:52:41 | 1 | 21,513 | Simd |
79,301,529 | 22,407,544 | How to alter data entered into django models to fit a criteria? | <p>I have a django models.py file that I use to store information in my database. I store information on businesses and the countries that they operate in. I get the list of countries from their website. However they may call each country by a different name or use different formatting, for example 'The Gambia' vs 'Gam... | <python><django> | 2024-12-22 18:49:03 | 0 | 359 | tthheemmaannii |
79,301,465 | 5,837,773 | Plotly not exporting images in Flask route with Kaleido | <p>I have a Flask app where I need to display some images. Beside that I also want to store them locally with <code>pio.write_image</code> as explained in <a href="https://plotly.com/python-api-reference/generated/plotly.io.write_image.html" rel="nofollow noreferrer">docs</a>. This works ok, if used in regular python, ... | <python><flask><plotly><kaleido> | 2024-12-22 18:08:10 | 0 | 409 | Gregor Sotošek |
79,301,108 | 3,331,037 | Google's Gemini on local audio files | <p>Google <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-audio-transcription" rel="nofollow noreferrer">has a page</a> describing how to use one of their Gemini-1.5 models to transcribe audio. They include a sample script (see below). The script grabs the audio file... | <python><audio><large-language-model><google-gemini> | 2024-12-22 13:48:53 | 1 | 498 | Bill Bradley |
79,301,100 | 19,556,055 | Dask distributed.protocol.core - CRITICAL - Failed to deserialize with OutOfData exception | <p>I want to use XGBoost with Dask, which requires a client to be passed to the train method. When I try to read the data without defining a client, everything works fine, but when I run the code below I get <code>distributed.protocol.core - CRITICAL - Failed to deserialize</code> with an <code>OutOfData</code> excepti... | <python><dask><dask-distributed> | 2024-12-22 13:43:37 | 0 | 338 | MKJ |
79,301,038 | 2,414,934 | solve Sympy functions in Scipy (optimize.root) | <p>I'm trying to find the roots with the root function in Scipy for functions/variables created in Sympy.</p>
<p>sympy:</p>
<pre><code>AllEquations = [x1 - 5, y1 - 5, z1 - 5, ((x1 - x2)**2 + (y1 - y2)**2 + (z1 - z2)**2)**0.5 - 150, y2 - 100, z2, ((x1 - x2)**2 + (y1 - y2)**2 + (z1 - z2)**2)**0.5 - 150]
AllVariables = [... | <python><scipy><sympy><scipy-optimize> | 2024-12-22 13:07:45 | 2 | 673 | Achaibou Karim |
79,300,639 | 7,233,155 | Configure AirspeedVelocity for Python package with PyO3 and Maturin | <p>I'm trying to setup Airspeed Velocity to use with my Python project. In other setups, such as github workflows the only build commands needed are:</p>
<pre><code> "python -m pip install --upgrade pip",
"pip install .[dev] -v"
</code></pre>
<p>But this won't work with ASV. I have rust-PyO3... | <python><benchmarking><pyo3> | 2024-12-22 07:39:30 | 0 | 4,801 | Attack68 |
79,300,495 | 759,880 | Making FastAPI ML server faster | <p>I have a FastAPI server where upon a HTTP <code>GET</code> (<code>/get_documents/</code>), there are 2 bottlenecks to returning a response fast: there is a call to another server via a client ("get vectors"), then there is a call to an LLM (in process memory) to generate text. Both are very slow. I'm think... | <python><async-await><concurrency><fastapi> | 2024-12-22 05:07:58 | 0 | 4,483 | ToBeOrNotToBe |
79,300,354 | 2,403,945 | How to insert a unicode text to PDF using PyMuPDF? | <p>I'm trying to use the PyMuPDF library to insert a Unicode text into a PDF file. I have the following code based on the documentation example:</p>
<pre class="lang-py prettyprint-override"><code>import pymupdf
doc = pymupdf.open()
page = doc.new_page()
p = pymupdf.Point(50, 72)
# String in Sinhala language
text = (... | <python><pdf><unicode><pymupdf> | 2024-12-22 01:46:25 | 2 | 1,459 | paarandika |
79,300,265 | 7,729,563 | Is it possible to type annotate Python function parameter used as TypedDict key to make mypy happy? | <p>While working through code challenges I am trying to use type annotations for all function parameters/return types. I use mypy in strict mode with the goal of no errors.</p>
<p>I've spent some time on this one and can't figure it out - example of problem:</p>
<pre class="lang-py prettyprint-override"><code>from typ... | <python><python-typing><mypy> | 2024-12-21 23:34:41 | 2 | 529 | James S. |
79,300,021 | 7,349,864 | Sock Bind error in Apache Functions Python in local | <p>I'm testing Apache Functions and I'm trying to test my function locally</p>
<p>For this, I have started the local server with</p>
<pre><code>fn start --log-level DEBUG --port 8080
</code></pre>
<p>and I'm trying to create, deploy and invoke a test function with</p>
<pre><code>fn use context default
fn update context... | <python><rancher><rancher-desktop><fn> | 2024-12-21 19:57:22 | 0 | 2,208 | Sourcerer |
79,299,996 | 13,975,447 | bulk_update cloudflare KV attribute error python | <p>I am using python to bulk_update the KV using this
<a href="https://developers.cloudflare.com/api/python/resources/kv/subresources/namespaces/methods/bulk_update/" rel="nofollow noreferrer">https://developers.cloudflare.com/api/python/resources/kv/subresources/namespaces/methods/bulk_update/</a></p>
<p>when using an... | <python><cloudflare><cloudflare-kv> | 2024-12-21 19:33:29 | 1 | 3,426 | Abdulaziz |
79,299,983 | 19,356,117 | DistNetworkError when using multiprocessing_context parameter in pytorch dataloader | <p>Because of some special reasons I want to use <code>spawn</code> method to create worker in <code>DataLoader</code> of Pytorch, this is demo:</p>
<pre><code>import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.utils.data import TensorDataset
import lightni... | <python><pytorch><python-multiprocessing><pytorch-lightning> | 2024-12-21 19:27:59 | 0 | 1,115 | forestbat |
79,299,956 | 6,000,382 | How to actually use cv2.estimateAffine3D to align 3d points in python? | <p>I want to compute a similarity alignment that overlays two sets of points in correspondence (rotation, scaling, translation). OpenCV has a lovely function for doing this, estimateAffine3D(). Despite a couple of other stack overflow questions about it, noone has presented an actual example of how to use this function... | <python><opencv><geometry> | 2024-12-21 19:05:43 | 1 | 974 | welch |
79,299,748 | 7,396,306 | Count number of characters in each row and drop if all are below a certain number | <p>I have a dataframe with many columns, all of which contain text data mixed with <code>NaNs</code>.</p>
<p>I want to count the number of characters in each cell in each column and then drop any rows where <strong>all</strong> the columns have less than 5 characters (if any cells have more than 5 characters, then the ... | <python><pandas><string><dataframe> | 2024-12-21 16:40:36 | 2 | 859 | DrakeMurdoch |
79,299,698 | 1,946,052 | Python Gekko ignores variable types | <p>With this code</p>
<pre><code>from gekko import GEKKO
model = GEKKO(remote=False)
x = model.Var(name='x', lb=0, ub=1, integer=True)
y = model.Var(name='y', lb=0, ub=10, integer=True)
z = model.Var(name='z')
model.Equation(x + y + z >= 10)
model.Equation(y - 2 * z <= 5)
model.Obj(x + 2 * y + 3 * z)
model.o... | <python><optimization><gekko><variable-types> | 2024-12-21 16:00:52 | 0 | 2,283 | Michael Hecht |
79,299,600 | 3,070,181 | How to show a dialog when using a spinbox in tkinter | <p>I have a spinbox in my tkinter application and I want to show a warning in certain circumstances</p>
<pre><code>import tkinter as tk
from tkinter import ttk, messagebox
widgets = None
root = None
def main() -> None:
global widgets
global root
root = tk.Tk()
root.title('Spinbox')
root.geomet... | <python><tkinter><dialog><tcl><spinner> | 2024-12-21 14:54:27 | 0 | 3,841 | Psionman |
79,299,542 | 1,788,656 | Geojsonio does not render jsonfile | <p>All,</p>
<p>The geojsonio package is not rendering simple JSON files on geojson.io as it should be. I get empty map as shown below</p>
<p><a href="https://i.sstatic.net/xVCCGpei.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/xVCCGpei.png" alt="enter image description here" /></a>
Here is the Python c... | <python><python-3.x><geojson><geopandas> | 2024-12-21 14:15:32 | 0 | 725 | Kernel |
79,299,276 | 1,788,656 | geopandas is missing states.geojson file | <p>All,
I got the following error when trying to import states.geojson file as described in this page <a href="https://www.twilio.com/en-us/blog/geospatial-analysis-python-geojson-geopandas-html" rel="nofollow noreferrer">https://www.twilio.com/en-us/blog/geospatial-analysis-python-geojson-geopandas-html</a>. I think t... | <python><python-3.x><geopandas> | 2024-12-21 10:54:38 | 1 | 725 | Kernel |
79,299,194 | 13,392,257 | FeatureStore: 'NoneType' object has no attribute 'utctimetuple' | <p>I am using feast library</p>
<p>And I am creating FeatureStore object in my script:</p>
<pre><code>def get_feature_store(config: Dict[str, str]):
spark_conf = read_spark_conf(config["spark_config_master_path"])
online_host, online_port = config["online_store_connection"].split(":&quo... | <python><feast> | 2024-12-21 09:50:15 | 0 | 1,708 | mascai |
79,299,062 | 10,115,137 | pip install PyGObject==3.50.0 complaints of stale meson even though latest meson present | <p>Upgrading PyGobject using</p>
<pre class="lang-bash prettyprint-override"><code>pip install PyGObject==3.50.0 --verbose
</code></pre>
<p>gives the error (see full error at the end)</p>
<pre class="lang-py prettyprint-override"><code>meson-python: error: Could not find meson version 0.63.3 or newer, found 0.61.2.
... | <python><installation><pip> | 2024-12-21 07:56:30 | 1 | 920 | lineage |
79,298,879 | 15,632,586 | ModuleNotFoundError: No module named 'huggingface_hub.inference._types' | <p>I am running a RAG pipeline, with LlamaIndex and quantized LLama3-8B-Instruct. I just installed these libraries:</p>
<pre><code>!pip install --upgrade huggingface_hub
!pip install --upgrade peft
!pip install llama-index bitsandbytes accelerate llama-index-llms-huggingface llama-index-embeddings-huggingface
!pip ins... | <python><large-language-model><huggingface><llama-index><retrieval-augmented-generation> | 2024-12-21 04:34:23 | 1 | 451 | Hoang Cuong Nguyen |
79,298,628 | 107,158 | How can I use Polars to stream the contents of a Parquet file as CSV text to standard output? | <p>Using <a href="https://www.python.org/" rel="nofollow noreferrer">Python</a> <a href="https://pola.rs/" rel="nofollow noreferrer">Polars</a>, how can I modify the following script to stream the contents of a <a href="https://parquet.apache.org/" rel="nofollow noreferrer">Parquet</a> file as <a href="https://en.wikip... | <python><dataframe><csv><parquet><python-polars> | 2024-12-20 23:39:58 | 2 | 28,456 | Derek Mahar |
79,298,621 | 22,407,544 | How to get my favicon at `example.com/favicon.ico` in my Django project? | <p>Google currently does not show my website's favicon in its search results and I learned that it is becuase it should be located at <code>example.com/favicon.ico</code>. I'm looking for a simple way to do this, hopefully without relying on redirects. I've used redirection to the version in my static folder but when I... | <python><django> | 2024-12-20 23:35:03 | 1 | 359 | tthheemmaannii |
79,298,447 | 4,048,657 | PyTorch scatter max for sparse tensors? | <p>I have the following PyTorch code</p>
<pre><code>value_tensor = torch.sparse_coo_tensor(indices=query_indices.t(), values=values, size=(num_lines, img_size, img_size)).to(device=device)
value_tensor = value_tensor.to_dense()
indices = torch.arange(0, img_size * img_size).repeat(len(lines)).to(device=device)
line_ten... | <python><pytorch> | 2024-12-20 21:36:06 | 1 | 1,239 | Cedric Martens |
79,298,424 | 219,153 | Generating binary arrays with alternating values based on change indices in NumPy | <p>I have an array <code>a</code> of increasing indexes, e.g. <code>[2 5 9 10]</code>, which indicates positions of value change. Assuming the output values are <code>0</code> and <code>1</code>, I want to get array <code>b</code>:</p>
<pre><code>[0 0 1 1 1 0 0 0 0 1 0]
</code></pre>
<p>Is there a NumPy magic to transf... | <python><numpy> | 2024-12-20 21:22:12 | 4 | 8,585 | Paul Jurczak |
79,298,368 | 4,907,639 | Inspect all probabilities of BERTopic model | <p>Say I build a BERTopic model using</p>
<pre><code>from bertopic import BERTopic
topic_model = BERTopic(n_gram_range=(1, 1), nr_topics=20)
topics, probs = topic_model.fit_transform(docs)
</code></pre>
<p>Inspecting <code>probs</code> gives me just a single value for each item in <code>docs</code>.</p>
<pre><code>prob... | <python><nlp><topic-modeling> | 2024-12-20 20:49:34 | 1 | 2,109 | coolhand |
79,298,069 | 15,673,975 | Importing a Python dependency from a private repository causes docker buildx build on Kubernetes to fail | <p>I have setup a Kubernetes pod to build Docker containers. The projects I'm building containers for have a Python dependency which is from a private repository. Here is the issue: if I run the <code>docker buildx build ...</code> command in my terminal, everything works.
If, however, I run the command through a Pytho... | <python><docker><kubernetes> | 2024-12-20 18:06:09 | 1 | 374 | ultrapoci |
79,298,043 | 5,403,987 | How to stop jupyter-book build from examining files in .venv directory | <p>I'm using jupyter-book. I recently switched from using a conda based environment to uv. uv creates a .venv directory at the top level. Now when I issue the command</p>
<pre><code>jupyter-book build .
</code></pre>
<p>I can see that jupyter-book is traversing the .venv directory as well and trying to build any markdo... | <python><python-sphinx><jupyterbook> | 2024-12-20 17:57:52 | 1 | 2,224 | Tom Johnson |
79,297,758 | 990,549 | How should I parse times in the Japanese "30-hour" format for data analysis? | <p>I'm considering a data analysis project involving information on Japanese TV broadcasts. The relevant data will include broadcast times, and some of those will be for programs that aired late at night.</p>
<p>Late-night Japanese TV schedules follow a non-standard time format called the <a href="https://ja.wikipedia.... | <python><pandas><numpy><datetime><python-polars> | 2024-12-20 15:52:43 | 2 | 1,050 | Shay Guy |
79,297,644 | 7,179,546 | How to get response with Nones when using the multiprocessing library on Python? | <p>I'm using the multiprocessing package for Python to parallelize 2 functions. Each of those functions return a dictionary that can have None as value for some keys, and when that happens I'm getting this error</p>
<blockquote>
<p>Error in multiprocessing my function: Error sending result: <code><Output of my funct... | <python><python-multiprocessing> | 2024-12-20 15:06:20 | 0 | 737 | Carabes |
79,297,329 | 1,358,829 | FB-Hydra: calling compose during hydra main is not properly finding configs in the searchpath | <p>I'm trying to call compose within <code>hydra.main</code>, but it is not properly using the searchpath I set in my main config. This is the organization of my script:</p>
<pre><code>my_script
┣ config
┃ ┣ config.yaml
┗ my_script.py
</code></pre>
<p>My scripts depend on a config package within a library I'm develo... | <python><python-3.x><fb-hydra> | 2024-12-20 13:09:56 | 1 | 1,232 | Alb |
79,297,217 | 8,458,083 | How can use statically typed check a dataclass create with make_dataclass | <p>When i create and use a dataclass the "normal way" I can run and type check my code mypy without problem.
For instance, this code works perfectly fine:</p>
<pre><code>@dataclass
class Person2:
name : str
age : int
height : float
def f2(p : Person2):
print(p)
</code></pre>
<p>But if I try t... | <python><python-typing><mypy> | 2024-12-20 12:19:42 | 1 | 2,017 | Pierre-olivier Gendraud |
79,297,127 | 19,573,290 | Putting a Tkinter window below all other windows | <p>I'm trying to make a Tkinter window appear below all other windows.</p>
<p>I know how to make it appear over all other windows:</p>
<pre class="lang-py prettyprint-override"><code>import tkinter as tk
root = tk.Tk()
root.attributes('-topmost', True)
root.mainloop()
</code></pre>
<p>But I'm trying to do the opposite... | <python><tkinter> | 2024-12-20 11:46:35 | 2 | 363 | stysan |
79,296,881 | 9,213,069 | Replace pandas column value by previous column value if cell contain a substring | <p>I'm using Python 3.6.8. I have a dataframe df with columns name & sport. I want to replace value of sport if it contains substring "replace this value for".</p>
<p>My dataframe is generated using following code</p>
<pre><code>import pandas as pd
df = pd.DataFrame({'name': ['Bob', 'Jane', 'Alice'],
... | <python><pandas> | 2024-12-20 10:21:24 | 2 | 883 | Tanvi Mirza |
79,296,865 | 3,414,663 | How to make a Python Dataclass mixin? | <p>To make a dataclass in Python you typically use the decorator. Something
like:</p>
<pre class="lang-none prettyprint-override"><code>from dataclasses import dataclass
@dataclass
class Foo:
n: int = 1
def bump(self):
self.n += 1
</code></pre>
<p>Alternatively you can use <code>make_dataclass</code>... | <python><mixins><python-dataclasses> | 2024-12-20 10:12:02 | 1 | 589 | user3414663 |
79,296,853 | 329,680 | sqlmodel ValueError: <class 'list'> has no matching SQLAlchemy type | <p>Given these classes and 1-to-N relationships, I get compile time error: <code>ValueError: <class 'list'> has no matching SQLAlchemy type</code> referring to the <code>category.py</code> field <code>todos: list["Todo"]</code>, while the relation <code>hero/team</code> does work.</p>
<p>I also tried to... | <python><orm><fastapi><sqlmodel> | 2024-12-20 10:08:24 | 3 | 1,016 | Fabio |
79,296,798 | 2,915,050 | Python unittest - how to unit test function to open files of specific file pattern | <p>I'm trying to write a unit test with <code>unittest</code> which tests that the behaviour of the below function only opens files that have a filename pattern of <code>test_*.json</code>.</p>
<pre><code>import glob
import json
def get_tests():
tests = []
for test in list(glob.iglob(f'**/test_*.json', recursi... | <python><mocking><python-unittest> | 2024-12-20 09:48:06 | 0 | 1,583 | RoyalSwish |
79,296,766 | 4,913,254 | Heatmap (seaborn) doesn't show all Ylabels | <p>My heatmap doesn't want to show all Ylabels.</p>
<p>This is the plot
<a href="https://i.sstatic.net/UmjzJlHE.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/UmjzJlHE.png" alt="enter image description here" /></a></p>
<p>And this is the code</p>
<pre><code>import pandas as pd
import seaborn as sns
impo... | <python><seaborn> | 2024-12-20 09:33:38 | 0 | 1,393 | Manolo Dominguez Becerra |
79,296,597 | 5,868,293 | Rolling window selection with groupby in pandas | <p>I have the following pandas dataframe:</p>
<pre><code># Create the DataFrame
df = pd.DataFrame({
'id': [1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2],
'date': [1, 2, 3, 4, 5, 6, 7, 8, 5, 6, 7, 8, 9, 10, 11, 12],
'value': [11, 12, 13, 14, 15, 16, 17, 18, 21, 22, 23, 24, 25, 26, 27, 28]
})
df
id date ... | <python><pandas> | 2024-12-20 08:24:15 | 5 | 4,512 | quant |
79,296,589 | 26,579,940 | pyqtgraph How to add multiple plots to one ax | <p>I want to open a window with pyqtgraph alone, without using pyqt.</p>
<p>I want to create two or more axes in one window through pyqtgraph, and draw two lines in one ax.
What should I do?</p>
<p>The following code creates multiple windows.</p>
<pre><code>import pandas as pd
import pyqtgraph as pg
a = [
{'a': 5,... | <python><pyqtgraph> | 2024-12-20 08:22:27 | 1 | 404 | white.seolpyo.com |
79,296,505 | 1,503,683 | Optimized way to replace a large list of dicts | <p>Let's say I have a (large) list of (large) dicts, for instance:</p>
<pre class="lang-json prettyprint-override"><code>my_list = [
{
"foo": "bar",
"foobar": "barfoo",
"something": 1,
"useless_bool": True
},
{
... | <python><dictionary> | 2024-12-20 07:48:32 | 1 | 2,802 | Pierre |
79,296,132 | 16,326,242 | How to backup the whole group chat in telegram with telethon? | <p>I would like to clone or backup or forward the messages (including files, videos) to another group. The groups have topics.</p>
<h4>What I have tried</h4>
<p>I tried to use a Telegram Bot with <code>telethon</code> but some functions cannot be accessed by bot. So, I used a phone number, actually three. They all got ... | <python><telegram><chat><telethon> | 2024-12-20 03:57:55 | 0 | 1,084 | Four |
79,296,036 | 4,048,657 | Construct a sparse tensor while propagating gradient? | <p>I have code similar to this I would like to make faster:</p>
<pre class="lang-py prettyprint-override"><code># indices: indices of a 3d tensor
# values associated to the indices
result = torch.zeros((L, N, N))
for idx, (i,j,k) in enumerate(indices):
mask = torch.zeros_like(result)
mask[i][j][k] = 1... | <python><pytorch> | 2024-12-20 02:24:31 | 1 | 1,239 | Cedric Martens |
79,296,005 | 759,880 | How to patch a 3rd party lib in a unit test with FastAPI client | <p>I have an <code>app/main.py</code> for FastAPI which does:</p>
<pre><code>import qdrant_client as QdrantClient
...
qdrant_client = QdrantClient(url=...)
qdrant_client.create_collection(...)
...
app = FastAPI()
...
@app.get("/my_endpoint")
def handle_my_endpoint(query: str):
...
qdrant_client.query_... | <python><fastapi><python-unittest><python-unittest.mock> | 2024-12-20 01:48:27 | 1 | 4,483 | ToBeOrNotToBe |
79,295,912 | 888,367 | How to get Gemini 1.5 to extract tabular data from an image? | <p>I need to extract pairs of code and description from a table with columns but no rows in an image like this:</p>
<p><a href="https://i.sstatic.net/TMHxZZ3J.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TMHxZZ3J.png" alt="table with four columns in Spanish" /></a></p>
<p>I tryed Gemini 1.5 Flash, pro... | <python><google-gemini> | 2024-12-20 00:14:27 | 1 | 530 | Andrés Meza-Escallón |
79,295,631 | 2,072,516 | Getting error related to lazy loading when adding many to many relationship | <p>I'm struggling with SQLAlchemy. I have a model with a many to many relationship set up:</p>
<pre><code>class User(Base):
roles: Mapped[List["Role"]] = relationship(
secondary="user_roles", back_populates="users"
)
</code></pre>
<p>I'm setting up some code to populate the... | <python><sqlalchemy> | 2024-12-19 21:17:13 | 1 | 3,210 | Rohit |
79,295,576 | 1,867,328 | Return elements from a list that match a pattern | <p>I have a list of words as below:</p>
<pre><code>STR = ['aa', 'dffg', 'aa2', 'AAA3']
</code></pre>
<p>I want to get a list of elements from the above list that match a string:</p>
<pre><code>to_match = 'aa'
</code></pre>
<p>I tried the code below:</p>
<pre><code>import re
[re.findall(to_match, iWord) for iWord in STR... | <python><regex><string><list> | 2024-12-19 20:54:51 | 2 | 3,832 | Bogaso |
79,295,537 | 8,372,455 | SSL Certificate Verification Error with Hugging Face Transformers CLI | <p>I'm trying to download the <code>TheBloke/falcon-40b-instruct-GPTQ</code> model using the Hugging Face Transformers CLI in PowerShell on Windows 10, but I consistently encounter an SSL certificate error. It appears to be same issues if I am using a Python script or Powershell even if I try just one time in downloadi... | <python><huggingface-transformers><huggingface><huggingface-trainer><huggingface-hub> | 2024-12-19 20:36:51 | 0 | 3,564 | bbartling |
79,295,261 | 10,832,189 | How to integrate a Stripe Terminal Reader to POS application using Django? | <p>I am developing a POS system using Django. I have a Stripe account, and through the system I am developing, I can process payments using credit or debit cards, with the money being deposited into my Stripe account. This is done by typing card information such as the card number, CVV, and expiration date.</p>
<p>Now,... | <python><django><stripe-payments> | 2024-12-19 18:23:46 | 1 | 395 | Mohamed Abdillah |
79,295,148 | 9,315,690 | How do I type hint a frame object in Python? | <p>I'm type hinting a large existing Python codebase, and in one part it sets a signal handler using <a href="https://docs.python.org/3/library/signal.html#signal.signal" rel="nofollow noreferrer"><code>signal.signal</code></a>. The signal handler is a custom function defined in the codebase, so I need to type hint it ... | <python><python-typing><mypy> | 2024-12-19 17:33:11 | 3 | 3,887 | Newbyte |
79,295,143 | 1,269,646 | sqlalchemy - how to get attributes from the query response into an object | <p>I am trying to get the some calculated value from a sqlquery into the object that should be instantiated, however access to those values seems impossible.</p>
<p>given three tables: A, B, A_to_B</p>
<ul>
<li>A - some model
<ul>
<li>somevalues</li>
<li>"totalsum"</li>
</ul>
</li>
<li>B - some model</li>
<l... | <python><sqlalchemy><associations> | 2024-12-19 17:31:19 | 2 | 1,090 | hlv |
79,295,111 | 8,554,611 | pyaudio produces no sound when using explicit device | <p>This code results in no sound output. Neither it sounds nor is indicated anywhere.</p>
<pre class="lang-py prettyprint-override"><code>from contextlib import suppress
from typing import Mapping
import pyaudio
import numpy as np
from numpy.typing import NDArray
freq: float = 130.0
p: pyaudio.PyAudio = pyaudio.PyAu... | <python><pyaudio> | 2024-12-19 17:18:13 | 0 | 796 | StSav012 |
79,295,062 | 8,769,985 | formatting output of gvar | <p>I use the <a href="https://pypi.org/project/gvar/" rel="nofollow noreferrer">gvar</a> library in python. This example, taken from the <a href="https://gvar.readthedocs.io/en/latest/overview.html#formatting-gvars-for-printing-display" rel="nofollow noreferrer">documentation</a> gives an error:</p>
<pre><code>>>... | <python><printing><gvar> | 2024-12-19 16:59:02 | 0 | 7,617 | francesco |
79,295,000 | 7,124,155 | How can I group these related rows using PySpark? | <p>I need to parse some text data in Python PySpark on Databricks. The data look like this:</p>
<pre><code>df = spark.createDataFrame([("new entry", 1, 123),
("acct", 2, None),
("cust ID", 3, None),
("new entry", 4, 456),
("acct", 5, None),
("... | <python><pyspark><databricks> | 2024-12-19 16:37:39 | 1 | 1,329 | Chuck |
79,294,915 | 3,130,747 | How to read multiple parquet files from a gcp storage bucket using duckdb and python | <ul>
<li>python version: Python 3.12.3</li>
<li>duckdb version: "1.1.3"</li>
</ul>
<p>I'm trying to get duckdb working to read multiple parquet files from a storage bucket dir using a glob pattern.</p>
<p>I can load a single file using the following:</p>
<pre class="lang-py prettyprint-override"><code># works... | <python><google-cloud-storage><parquet><duckdb> | 2024-12-19 16:02:34 | 1 | 4,944 | baxx |
79,294,881 | 7,959,614 | How can I get a certain number of evenly spaced points along the octagon perimeter? | <p>I want to get the coordinates of a number of points that together form an octagon.
For a circle this is done easily as follows:</p>
<pre><code>import numpy as np
n = 100
x = np.cos(np.linspace(0, 2 * np.pi, n))
y = np.sin(np.linspace(0, 2 * np.pi, n))
coordinates = list(zip(x, y))
</code></pre>
<p>By changing <cod... | <python><matplotlib> | 2024-12-19 15:52:27 | 6 | 406 | HJA24 |
79,294,784 | 13,090,289 | ImportError in Hugging Face Integration: `LocalEntryNotFoundError` when using Llama Index and transformers | <p>I am working on an AI project with <code>Llama Index</code> and the <code>transformers</code> library, integrating Hugging Face models. Below is my code snippet:</p>
<pre class="lang-py prettyprint-override"><code>from llama_index.core import Settings
from llama_index.embeddings.huggingface import HuggingFaceInferen... | <python><huggingface-transformers><importerror><huggingface><llama-index> | 2024-12-19 15:23:53 | 1 | 436 | Deepak Singh Rajput |
79,294,628 | 16,611,809 | How to dynamically adjust colors depending on the dark mode? | <p>The default header color for DataFrames (<code>render.DataGrid()</code>, <code>render.DataTable()</code>) is a very light grey (probably <code>gainsboro</code>). If I switch an app to dark mode using and DataFrame the header becomes unreadable. Is there any way to make a dict to tell shiny what color to use for the ... | <python><darkmode><py-shiny> | 2024-12-19 14:28:32 | 1 | 627 | gernophil |
79,294,574 | 2,859,206 | In Pandas, how to reference and use a value from a dictionary based on column AND index values in a dataframe? | <p>I've data about how my times people are sick in certain locations (location A and B) at certain times (index of dates). I need to divide each value by the population in that location (column) AND at that time (index), which references a separate dictionary.</p>
<p>Eg dataframe:</p>
<pre><code>import pandas as pd
dat... | <python><pandas><dataframe><dictionary> | 2024-12-19 14:10:46 | 2 | 2,490 | DrWhat |
79,294,507 | 7,334,912 | Diffusers pipeline Instant ID with Ipadapter | <p>I want to use an implementation of <a href="https://github.com/instantX-research/InstantID" rel="nofollow noreferrer">InstantID</a> with <a href="https://huggingface.co/docs/diffusers/main/using-diffusers/ip_adapter" rel="nofollow noreferrer">Ipadapter</a> using Diffusers library.
So far I got :</p>
<pre><code>impor... | <python><deep-learning><stable-diffusion><diffusers> | 2024-12-19 13:51:35 | 0 | 502 | Felox |
79,294,496 | 4,108,376 | Writing Windows registry with backslash in sub-key name, in Python | <p>I'm trying to write into the Windows registry key "SOFTWARE/Microsoft/DirectX/UserGpuPreferences" using the Python winreg module.</p>
<p>The name of the sub-key needs to be the python executable path, which contains backslashes. However when using <code>winreg.SetValue()</code>, this instead adds a tree of... | <python><registry><winreg> | 2024-12-19 13:46:56 | 1 | 9,230 | tmlen |
79,294,413 | 9,189,389 | Second independent axis in Altair | <p>I would like to add a second (independent) x-axis to my figure, demonstrating a month for a given week.</p>
<p>Here is my snippet:</p>
<pre><code>import pandas as pd
import numpy as np
from datetime import datetime, timedelta
weeks = list(range(0, 54))
start_date = datetime(1979, 1, 1)
week_dates = [start_date + ti... | <python><altair> | 2024-12-19 13:16:23 | 2 | 464 | Luckasino |
79,294,236 | 5,457,202 | ValueError: setting an array element with a sequence in Vaex dataframe | <p>I've been given a CSV file from a previous project and I'm supposed to prepare some scripts with Python to plot the value it contains. The dataset in this CSV file holds data from electric and vibration signals. The data I'm interested in is stored at a column, "DecompressedValue", where each row holds a 1... | <python><pandas><numpy><vaex> | 2024-12-19 12:11:16 | 1 | 436 | J. Maria |
79,294,037 | 275,088 | How does creating a Python venv with `--system-site-packages` work under the hood? | <p>I'm trying to understand how creating a Python venv with access to the system site-packages work. The <a href="https://docs.python.org/3/library/venv.html" rel="nofollow noreferrer">documentation</a> doesn't go much into details, so I've just checked the diff between two venvs with and without the <code>--system-sit... | <python><python-venv> | 2024-12-19 11:04:27 | 1 | 16,548 | planetp |
79,294,022 | 15,136,864 | invalid_client when trying to authenticate with client_id and client_secret using django oauth toolkit and rest framework | <p>I’m running a Django service that exposes endpoints via Django REST Framework. I want to secure these endpoints using Django OAuth Toolkit for authentication.</p>
<p>When I create an application from the admin panel, I use the following settings:</p>
<p><a href="https://i.sstatic.net/Kh6elhGy.png" rel="nofollow nore... | <python><django><django-rest-framework><oauth-2.0><django-oauth-toolkit> | 2024-12-19 10:59:12 | 0 | 310 | Sevy |
79,293,972 | 5,658,512 | Need to fix Regex in the PostgreSQL Search | <p>I am in need to use the Word Boundary(\y) as a condition to match the exact word which is been searched as a Query Param. I am writing this regex and executing in PostgreSQL but it is returning FALSE.</p>
<p><strong>text_search_value = "apple."</strong> (Which needs to be exactly matched in the {doc_table}... | <python><sql><regex><postgresql><vector-search> | 2024-12-19 10:41:01 | 2 | 4,280 | Naresh Kumar P |
79,293,889 | 12,813,584 | catelog sentences into 5 words that represent them | <p>I have dataframe with 1000 text rows. <code>df['text']</code></p>
<p>I also have 5 words that I want to know for each one of them how much they represnt the text (between 0 to 1)</p>
<p>every score will be in <code>df["word1"]</code> ,<code>df["word2"]</code> and etc</p>
<p>I will glad for recom... | <python><pandas><nlp><text-mining><similarity> | 2024-12-19 10:16:47 | 1 | 469 | rafine |
79,293,738 | 12,297,666 | Excessively increased training time for multiple Keras Conv1d networks within a for loop | <p>I am training several Keras models inside a for loop. Check the following code:</p>
<pre><code>import os
import time
import pandas as pd
import tensorflow as tf
import numpy as np
import unicodedata
from keras.models import Sequential
from keras.layers import InputLayer
from keras.layers import Conv1D
from keras.lay... | <python><tensorflow><keras> | 2024-12-19 09:29:18 | 0 | 679 | Murilo |
79,293,591 | 8,335,151 | How to define Output in AML pipelien? | <p>Here is my AML pipeline using python SDK v2.</p>
<pre><code>input_path = Input(type="uri_folder", path="azureml://datastores/test/paths/input")
output_path = Output(type="uri_folder", path="azureml://datastores/test/paths/output")
</code></pre>
<pre><code>@command_component(
... | <python><azure><azure-machine-learning-service><azure-pipelines-yaml> | 2024-12-19 08:37:30 | 1 | 3,765 | AnonymousKKYY |
79,293,528 | 2,695,990 | How to replace xml node value in Python, without changing the whole file | <p>Doing my first steps in python I try to parse and update a xml file.
The xml is as follows:</p>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="util/style/aaaa-2-0.xsl" type="text/xsl"?>
<!DOCTYPE eu... | <python><xml><xpath><xml-parsing><elementtree> | 2024-12-19 08:18:55 | 4 | 3,174 | fascynacja |
79,293,424 | 15,460,398 | Visualizer freezes for down-sampled point cloud of OAK-D camera | <p>Currently, I am using an OAK-D PRO FF camera. The platform is Windows 10.</p>
<p>Following the <a href="https://docs.luxonis.com/software/depthai/examples/pointcloud_visualization/" rel="nofollow noreferrer">documentation</a>, I can visualize the point cloud from the camera. I want to downsample the point cloud usin... | <python><python-3.x> | 2024-12-19 07:33:05 | 0 | 361 | BeamString |
79,293,377 | 726,730 | Cannot close correctly aiortc RTCPeerConnection after client disconnect | <p>offer:</p>
<pre class="lang-py prettyprint-override"><code>
async def offer(self, request):
try:
params = await request.json()
peer_connection = {
"name": params["name"],
"surname": params["surname"],
... | <python><p2p><rtcpeerconnection><aiortc> | 2024-12-19 07:16:31 | 0 | 2,427 | Chris P |
79,293,270 | 3,003,072 | Python: efficient unpacking large dictionary with list of strings as values to list of lists of keys | <p>I have a large dictionary with lists of strings as values. These strings can be duplicated. I would like to convert this dictionary to a list of lists of keys. The goal is to <strong>correlate the keys of original dictionary to unique strings so that later I can easily pick up all the keys for any unique string</str... | <python> | 2024-12-19 06:20:52 | 1 | 616 | Elkan |
79,293,171 | 2,037,570 | import of a function from nested structure | <p>Consider this directory structure:</p>
<pre><code>a-a
| b
| c
| print.py
</code></pre>
<p>Basically a-a/b/c. and print.py inside that directory. The contents of print.py looks like as :</p>
<pre><code>def print_5():
print("5")
def print_10():
print("10")
</code></pre>
<p... | <python> | 2024-12-19 05:18:28 | 2 | 3,645 | Hemant Bhargava |
79,293,060 | 772,649 | How to set multiple elements conditionally in Polars similar to .loc in Pandas? | <p>I am trying to set multiple elements in a Polars DataFrame based on a condition, similar to how it is done in Pandas. Here’s an example in Pandas:</p>
<pre class="lang-py prettyprint-override"><code>import pandas as pd
df = pd.DataFrame(dict(
A=[1, 2, 3, 4, 5],
B=[0, 5, 9, 2, 10],
))
df.loc[df['A'] < df... | <python><dataframe><python-polars> | 2024-12-19 03:44:50 | 3 | 97,797 | HYRY |
79,292,925 | 4,701,426 | Interacting with the "save as" window when downloading a webpage in Chrome using Selenium | <p>I have two scripts:</p>
<ol>
<li><code>other.py</code> looks like this:</li>
</ol>
<blockquote>
<pre><code># some stuff is done here and a list of urls is created such as:
urls = ['https://www.walmart.com/ip/Sabrina-Carpenter-Cherry-Pop-EDP-30ml-1oz/5492571361?classType=REGULAR&athbdg=L1600', 'https://www.walma... | <python><selenium-webdriver> | 2024-12-19 01:48:17 | 1 | 2,151 | Saeed |
79,292,914 | 8,458,083 | Why does unpacking with the new generic syntax in Python 3.13 cause a mypy error? | <p>I am trying to use the new generic type syntax introduced in Python 3.13 for defining type aliases with unpacking (*). While the code executes correctly, mypy raises a type-checking error. The same code works fine when using the old generic syntax.
Here is my code using the old generic syntax, which works both at ru... | <python><python-typing><mypy><python-3.13> | 2024-12-19 01:41:26 | 0 | 2,017 | Pierre-olivier Gendraud |
79,292,913 | 432,509 | Are there any drawbacks to assigning `__slots__` from `__annotations__` in a Python class? | <p>With Python's type annotations, classes that declare <code>__slots__</code> often end up duplicating the class identifiers.</p>
<p>A brief example:</p>
<pre><code>class Event:
location: tuple[float, float]
index: int
__slots__ = (
"location",
"index",
)
</code></p... | <python><python-typing><slots> | 2024-12-19 01:40:24 | 1 | 49,183 | ideasman42 |
79,292,846 | 5,942,779 | Use Python's logging to overwriting previous console line | <p>I want to use Python's logging library to overwrite the previous console line. It should display <code>...</code> on the console while the process is running, then overwrite it with <code>OK</code> once the process completes, as shown in this Python code.</p>
<pre class="lang-py prettyprint-override"><code>import ti... | <python> | 2024-12-19 00:37:00 | 2 | 689 | Scoodood |
79,292,593 | 6,041,629 | How to parallelize scipy.optimize basinhopping? | <p>I am performing many optimizations on a vector of about 100 values, with the optimization inputs changing each timestep, based on the previous timestep's optimization's results.</p>
<p>Optimization is done using Scipy.Optimize.Basinhopping. Each optimization step takes 10-20 seconds to run. Is it possible to paralle... | <python><optimization><scipy> | 2024-12-18 21:54:16 | 0 | 526 | Kingle |
79,292,473 | 1,361,752 | Display holoviews in jupyter in an air-gapped (offline) environment | <p>How should you use Holoviews with a bokeh backend in an air-gapped system (one with no internet access)?</p>
<p>In such cases its possible to get bokeh to still display using inline in a jupyter notebook by putting the following at the top of your notebook:</p>
<pre class="lang-py prettyprint-override"><code>import ... | <python><bokeh><holoviews> | 2024-12-18 21:04:09 | 1 | 4,167 | Caleb |
79,292,404 | 620,679 | Add a list property to a pd.DataFrame subclass | <p>I'm using a subclass of pandas' DataFrame class. The subclass needs to have a property that is a list. Here's an example:</p>
<pre><code>import pandas as pd
class MyDataFrame(pd.DataFrame):
def __init__(self, data, colors, *args, **kwargs):
m = pd.DataFrame(data)
super().__init__(m, *args, **kwa... | <python><pandas> | 2024-12-18 20:30:00 | 1 | 4,041 | Scott Deerwester |
79,292,303 | 395,255 | how to format output with newlines using ast module | <p>I am trying to generate some code using AST module. This is how my code looks like:</p>
<p>I would like to add new line after each key with proper formatting so that the output looks formatted.</p>
<pre><code>my_awesome_properties = [
(ast.Constant(value="key1"), ast.Constant(value="value1"))... | <python><abstract-syntax-tree> | 2024-12-18 19:41:40 | 2 | 12,380 | Asdfg |
79,292,298 | 17,721,722 | How to Automatically Detect PySpark Home Path from PyInstaller Executable? | <p>In my local development environment, I can easily run a PySpark application without configuring anything. However, on the server, we are using PyInstaller for EXE deployment. PyInstaller does not include the PySpark libraries' <code>_internal</code> folder in the executable, so I have to manually set the path.</p>
<... | <python><django><ubuntu><pyspark><pyinstaller> | 2024-12-18 19:38:04 | 1 | 501 | Purushottam Nawale |
79,292,192 | 6,345,518 | Regex match only if odd number of a character precede and follow | <p>I want to match the closing quote together with the opening quote of the following string if both are on the same line. Two strings may be separated either by a blank <code> </code> or a <strong>blank</strong>-plus-<strong>blank</strong> <code> + </code>.</p>
<p>Regex engine: Python</p>
<p>F.i. from</p>
<pre><code>t... | <python><regex> | 2024-12-18 18:54:22 | 3 | 5,832 | JE_Muc |
79,292,094 | 5,941,624 | Print randomly progress bar in tqdm | <p>I want to use tqdm in a loop such as:</p>
<pre><code>def __process_each_iteration(self, imputer) -> tuple[int, float, float]:
progress_bar= tqdm(
range(self.base_imputed_df.shape[1]),
desc="Processing...: ",
bar_format=(
"{l_bar}{bar}| Iteration {n_fmt}/{tota... | <python><tqdm> | 2024-12-18 18:13:31 | 0 | 331 | fatemeakbari |
79,292,053 | 1,028,270 | keyrings.google-artifactregistry.auth for python AR repo without a service account JSON key | <p>I don't use non-expiring service account JSON keys; I use ambient creds and OIDC everywhere, so I can't generate and use json keys for AR.</p>
<p>I want to do pip installs in my Dockerfiles to install my private AR packages.</p>
<p>Doing something like this works:</p>
<pre><code># Passing in a non expiring key
docke... | <python><google-cloud-platform><pip><google-iam><google-artifact-registry> | 2024-12-18 17:56:04 | 3 | 32,280 | red888 |
79,291,973 | 5,920,776 | Python Flask Saving/Sharing Query results between routes | <p>I'm developing a python flask web application that takes user input for which cities to plan a route for, geocodes the input cities by querying a third party API, and uses that result to query another API to determine the optimal route and driving directions.</p>
<p>I have two routes that use the output of the optim... | <python><flask> | 2024-12-18 17:21:16 | 0 | 438 | PhDavey |
79,291,938 | 3,070,181 | How to get a reference to traced variable in tkinter | <p>I have a tkinter application with variable number of entries and I want to detect changes to the contents and specifically, which entry has been changed</p>
<pre><code>import tkinter as tk
from tkinter import ttk
DOGS = 3
def main() -> None:
root = tk.Tk()
root.title('')
root.geometry('400x400')
... | <python><tkinter><callback> | 2024-12-18 17:08:48 | 1 | 3,841 | Psionman |
79,291,893 | 12,115,498 | Computing an iterated integral by iteratively applying the 1D trapezoidal rule | <p>I have a Python function, called <code>trap_1D</code>, which computes the (approximate) integral of a univariate function f over an interval [a,b] using the composite trapezoidal rule. Now I want to evaluate an iterated integral of the form \int_{a}^{b} \int_{c}^{d} f(x,y) dy dx by iteratively calling <code>trap_1D<... | <python><numpy><numerical-methods><numerical-integration> | 2024-12-18 16:52:04 | 2 | 783 | Leonidas |
79,291,863 | 902,570 | Algorithm for Compact Representation of Tuples Using Cartesian Product | <p>I have the following set of tuples:</p>
<pre><code>('red', 'hot', 'big'),
('red', 'hot', 'small'),
('red', 'cold', 'big'),
('blue', 'hot', 'big'),
('blue', 'cold', 'big'),
('green', 'hot', 'big'),
('green', 'cold', 'big')
</code></pre>
<p>I would like to create a compact representation of the above, where a tuple el... | <python><algorithm><tuples><minimize> | 2024-12-18 16:45:00 | 2 | 717 | depthofreality |
79,291,770 | 9,557,881 | Fill pandas columns based on datetime condition | <p>Here is the sample code to generate a dataframe.</p>
<pre><code>import pandas as pd
import numpy as np
dates = pd.date_range("20241218", periods=9600,freq='1MIN')
df = pd.DataFrame(np.random.randn(9600, 4), index=dates, columns=list("ABCD"))
</code></pre>
<p>I want to fill all the columns ... | <python><pandas><dataframe><datetime> | 2024-12-18 16:16:17 | 1 | 676 | Abhishek Kulkarni |
79,291,701 | 1,330,237 | Conda python package installs in wrong place | <p>I have created a pure python conda package called <code>ssstack</code> using <code>conda build</code>, but when I install it (from the local build directory) using:</p>
<pre><code>conda create -n <env name> -c <path to local build> ssstack`
</code></pre>
<p>the python package and CLI executables get <str... | <python><conda><conda-build> | 2024-12-18 15:47:09 | 1 | 3,230 | ccbunney |
79,291,557 | 536,262 | python pyproject.toml - arch dependency solved on install | <p>In <code>pyproject.toml</code> we have a optional-dependencies for a windows package:</p>
<pre class="lang-ini prettyprint-override"><code>[project.optional-dependencies]
windows = [
"pywinpty>=2.0.14"
]
</code></pre>
<p>To install:</p>
<pre class="lang-bash prettyprint-override"><code># on windows
... | <python><pip><python-packaging><pyproject.toml> | 2024-12-18 15:05:07 | 1 | 3,731 | MortenB |
79,291,519 | 8,458,083 | How to build a type from another type and make mypy checking work | <p>I'm working with Python's type hinting system and I'm trying to create a type alias for a function that's similar to an existing function type, but with one additional argument. Here's what I've attempted:</p>
<pre><code>from typing import Callable
# Original function type
RK_function = Callable[[float, int], int]
... | <python><python-typing><mypy> | 2024-12-18 14:51:22 | 2 | 2,017 | Pierre-olivier Gendraud |
79,291,512 | 16,611,809 | How to target Shiny's inputs with CSS selectors? | <p>I want to CSS style my Shiny for Python input fields, but it somehow doesn't work. I can however style the card headers. Does anyone know, what I am doing wrong? Or can the ui.input* elements not be styled directly?</p>
<pre><code>from shiny import App, render, ui, reactive
from pathlib import Path
app_ui = ui.pag... | <python><css><py-shiny> | 2024-12-18 14:48:15 | 1 | 627 | gernophil |
79,291,434 | 10,311,645 | Torch installation: No matching distribution found for torch>=2.0.0 | <p>I am trying to install version of pytorch as per the requirements.txt file which looks like:</p>
<pre><code># --------- pytorch --------- #
torch>=2.0.0
torchvision>=0.15.0
lightning>=2.0.0
torchmetrics>=0.11.4
</code></pre>
<p>I create a new venv and then run <code>pip install -r requirements.txt</code>... | <python><pytorch><torch> | 2024-12-18 14:26:39 | 1 | 313 | tam63 |
79,291,415 | 2,534,342 | Convert pythorch pth model to onnx with fixed width and variable height | <p>My code uses PyTorch to perform segmentation annotations on PNG images. The input images have a width of 512 pixels or a multiple of this, but the height can range from 400 to 900 pixels. The code, along with the PyTorch model (*.pth file), works as expected.</p>
<p>I am currently attempting to convert my *.pth mode... | <python><pytorch><onnx><onnxruntime> | 2024-12-18 14:22:31 | 1 | 612 | alanwilter |
79,291,388 | 1,176,347 | How do you add min and max values to plotly.graph_objects.Box if I'm passing Precomputed Quartiles? | <p>I'm using code from the example official documentation <a href="https://plotly.com/python/box-plots/" rel="nofollow noreferrer">https://plotly.com/python/box-plots/</a> -> <code>Box Plot With Precomputed Quartiles</code>. In such cases, plotly using q1 for mix and q3 for max.</p>
<pre class="lang-py prettyprint-o... | <python><plotly><jupyter-lab> | 2024-12-18 14:11:10 | 1 | 543 | greggyNapalm |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.