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,692,953 | 305,597 | How can I prevent matplotlib from trying to build the font cache on first run? | <p>I am using <code>PyInstaller</code> to bundle Python and several of its libraries on a single MacOS app, so I can distribute some software without any kinds of dependencies.</p>
<p>The first time anyone runs this "fresh" copy of Python + matplotlib, it spends a significant amount of time trying to build th... | <python><macos><matplotlib><fonts><pyinstaller> | 2025-07-07 13:43:08 | 1 | 9,705 | Martín Fixman |
79,692,951 | 1,503,120 | Custom type object tests as member of sequence but not of dictionary | <p>The <a href="https://docs.python.org/3/reference/expressions.html#in" rel="nofollow noreferrer">official Python docs for the <code>in</code> operator</a> state:</p>
<blockquote>
<p>For container types such as list, tuple, set, frozenset, dict, or collections.deque, the expression <code>x in y</code> is equivalent to... | <python> | 2025-07-07 13:42:40 | 1 | 1,276 | jamadagni |
79,692,691 | 20,292,449 | MCP connection fails silently | <p>I am new to MCP and I am having the bellow connection failure error and note that with the minimal set up it Works and I have tried using many ways it does not work and I have also followed the official guideline from the docs and used <code>uv</code> for the installation and environment setup and also the MCP inspe... | <python><model-context-protocol> | 2025-07-07 10:19:35 | 1 | 532 | ayex |
79,692,625 | 13,682,559 | How to type hint a python factory method returning different types? | <p>I am working on a generic framework with the goal to solve different but related problems. A problem consists of data and a bunch of algorithms operating on this data. Data and algorithms may vary from problem to problem, so I need different classes. But they all share a common interface.</p>
<p>I start with a confi... | <python><generics><python-typing><factory-method> | 2025-07-07 09:35:18 | 1 | 1,108 | Durtal |
79,692,584 | 8,771,201 | Python cut text in pieces to upload to Wordpress Blog | <p>I have a piece that already has some formatting. Now I need to convert this to a format so I can use the Wordpress API to send it to wordpress.</p>
<p>This is an example of my text:</p>
<pre><code>'**H1: Some text**\n\nSome text as paragraph.\n\n**H2: A subheader**\n\nText from the subheader.\n\nA line break with so... | <python><wordpress><wordpress-rest-api> | 2025-07-07 09:11:53 | 1 | 1,191 | hacking_mike |
79,692,579 | 5,760,832 | Unable to use dask-sql due to 'dask_expr.io' module | <h1>Aim:</h1>
<ol>
<li>Read data from Parquet files</li>
<li>Register each df as Table</li>
<li>Use dask-sql to join & query from the table</li>
</ol>
<p>Here are the installation step:</p>
<ul>
<li><code>pip install --force-reinstall --no-cache-dir "dask[complete]" dask-sql </code></li>
<li><code>pip ins... | <python><dataframe><dask><dask-dataframe> | 2025-07-07 09:09:44 | 1 | 891 | Aqua 4 |
79,692,568 | 243,872 | showing 2 raised to the power of a fractional argument in sympy | <p>I'm trying to display 2^{\frac{1}{12}} in a jupyter notebook
using the following Python code:</p>
<pre><code>
from sympy import *
pow(2,Rational(1, 12))
</code></pre>
<p>which gives me</p>
<p><a href="https://i.sstatic.net/3GwcEeLl.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3GwcEeLl.png" alt="12... | <python><jupyter-notebook><sympy> | 2025-07-07 09:03:24 | 1 | 1,193 | Krischu |
79,692,554 | 7,208,627 | What's the use case for `torch.randn_like` when`requires_grad=True`? | <p>In PyTorch, <code>requires_grad</code> can be set to <code>True</code> in <code>torch.randn_like</code>, what's the use case for this?</p>
<p>Say we have $\epsilon ~ N(0, I)$, to my understanding, since $\epsilon$ is not a parameter, there is no need to pipe gradient through it.</p>
<p>Thanks in advance.</p>
| <python><pytorch> | 2025-07-07 08:52:15 | 1 | 941 | Incömplete |
79,692,434 | 4,776,486 | How to reply for messages in telegram? in python | <p>I created a simple python program to automatically reply messages in <strong>Group topics</strong>, part of it :</p>
<pre><code>bot = Client(name=login, api_id=api_id, api_hash=api_hash, phone_number=phone)
@bot.on_message(filters.text)
async def command_handler(client: Client, message: Message):
if re.match(pa... | <python><pyrogram> | 2025-07-07 07:13:59 | 1 | 1,490 | voipp |
79,692,297 | 997,239 | python pip compile is rending absolute path of requirements.in file | <p>Python version: 3.12
pip-tools: 7.4.1</p>
<p>Project structure</p>
<pre><code>/projectdir
------requirements/
------------requirements.in
------------requirements.txt
------------requirements-dev.in
------------requirements-dev.txt
------Makefile
</code></pre>
<p>Contents of requirements-dev.in</p>
<pre><code>-r req... | <python><python-3.x><makefile><pip><pip-tools> | 2025-07-07 04:06:53 | 0 | 537 | Tarun |
79,692,280 | 2,398,193 | Python Marimo Slider not Showing | <p>I was basically following the first few minutes of this video: <a href="https://www.youtube.com/watch?v=dbPj3GOFa-g" rel="nofollow noreferrer">https://www.youtube.com/watch?v=dbPj3GOFa-g</a></p>
<p>In other words I did in gitbash:</p>
<pre><code>uvx marimo --help
</code></pre>
<p>Then:</p>
<pre><code>uvx marimo edi... | <python><marimo> | 2025-07-07 03:36:33 | 1 | 477 | Jorge Lopez |
79,692,233 | 777,769 | How to automatically print a variable in pdb? | <p>I am debugging a code in Python using <code>Pdb</code>:</p>
<pre class="lang-py prettyprint-override"><code>a = [12, 3, 4, 10, 23, 1]
def compute(x):
return 2 * x
for i in a:
b = compute(i)
</code></pre>
<p>To trace the value of a variable inside the loop, I set a breakpoint at the first line of the loop... | <python><debugging><breakpoints><evaluation><pdb> | 2025-07-07 01:33:34 | 1 | 2,459 | Hamid Rouhani |
79,692,191 | 14,488,413 | In Python, how to find difference between a specific column in one dataframe and numeric columns of another dataframe? | <p>I have two datasets/dataframes <code>df1</code> and <code>df2</code>, I want to generate <code>df3</code> by finding the difference between numeric columns of df2 and df1's column_X.</p>
<pre><code>#### copy and paste below to generate df1 and df2
import pandas as pd
from random import uniform
import numpy as np
... | <python><pandas><for-loop><apply> | 2025-07-07 00:00:36 | 1 | 322 | nasa313 |
79,692,027 | 1,554,020 | How to correctly type-annotate a classmethod-like descriptor in python? | <p><code>classonlymethod</code> decorator/descriptor defined below is like the built-in <code>classmethod</code>, but you're not allowed to call the method on instances, only on the class itself.</p>
<pre><code>from typing import Concatenate, Self
from collections.abc import Callable
from functools import partial
cla... | <python><python-typing><class-method><pyright><python-descriptors> | 2025-07-06 19:06:45 | 3 | 14,259 | yuri kilochek |
79,692,022 | 606,943 | Apache Airflow DAG not running | <p>I have installed the Airflow Docker environment as described in this <a href="https://airflow.apache.org/docs/apache-airflow/stable/howto/docker-compose/index.html" rel="nofollow noreferrer">guide</a> (3.0.2)and I'm able to run a very simple DAG using the EmptyOperator.</p>
<p>However, when I create another DAG usin... | <python><airflow> | 2025-07-06 19:00:15 | 1 | 707 | Christian van R |
79,691,957 | 16,883,182 | How to configure the font used to render IME preview text in tkinter text input fields on Windows? | <h2>Problem Description</h2>
<p>I'm experiencing a problem concerning font configuration in Tkinter. The constructor of all Tkinter widgets have a <code>font</code> keyword argument which allows you to configure the font used for displaying text. <em>However</em>, this option doesn't seem to affect the <strong>IME prev... | <python><windows><tkinter><fonts><ime> | 2025-07-06 17:12:08 | 1 | 315 | I Like Python |
79,691,953 | 11,318,930 | Ridge Polynomial Regression: How to get parameters for equation found | <p>I've used sklearn for polynomial ridge regression. Using grid search, I am happy with the results. Now I would like to render it as a simple polynomial equation to run in a small python module. The sklearn function returns the degree and alpha parameter. The latter just sets regularization for training. The for... | <python><scikit-learn><regression><polynomial-approximations> | 2025-07-06 17:06:54 | 1 | 1,287 | MikeB2019x |
79,691,896 | 10,634,126 | Docker config for python/firefox/selenium scraping | <p>I have been trying to configure Docker within a repository that will be used for Python web-scraping, in some cases with Selenium (I am using a Firefox web-driver but I am driver-agnostic, just want to get this to work.)</p>
<p>I have the following docker-compose file in my root directory:</p>
<pre><code>services:
... | <python><docker><selenium-webdriver> | 2025-07-06 15:50:06 | 0 | 909 | OJT |
79,691,830 | 1,886,641 | cusolverDnDgesvdj for the computation of singular values only under Python | <p>I have set up the code below for the computation of the SVD of a matrix. The code uses <code>cuSOLVER</code>'s <code>cusolverDnDgesvdj</code>.</p>
<pre><code>import ctypes
import numpy as np
import pycuda.autoinit # implicit context creation
import pycuda.driver as cuda
# -------------------------------... | <python><cuda><svd><pycuda><cusolver> | 2025-07-06 14:22:37 | 0 | 21,685 | Vitality |
79,691,774 | 4,041,117 | Efficient way creating a dict of dict from a pandas dataframe | <p>I have a pandas dataframe of the following structure:</p>
<pre><code>d = {'I': ['A', 'B', 'C', 'D'], 'X': [ 1, 0, 3, 1], 'Y': [0, 1, 2, 1], 'Z': [1, 0, 0, 0], 'W': [3, 2, 0, 0]}
df = pd.DataFrame(data=d, columns=['I','X', 'Y', 'Z', 'W'])
df.set_index('I', inplace=True, drop=True)
</code></pre>
<p>I need to create a ... | <python><pandas><dataframe><dictionary><networkx> | 2025-07-06 13:16:46 | 3 | 481 | carpediem |
79,691,688 | 954,643 | mypy linter error (valid-type) with pydantic's Annotated pattern in a generic | <p>Why would the following give a linter error in the second case but not the first:</p>
<pre><code># OK:
type MyAnnotatedType = Annotated[int | None, Field(strict=True)]
# Error: Invalid type alias: expression is not a valid type mypy(valid-type)
type MyAnnotatedSeqType = Sequence[Annotated[int | None, Field(strict=Tr... | <python><python-typing><mypy><pydantic><type-alias> | 2025-07-06 11:00:51 | 1 | 8,064 | qix |
79,691,609 | 1,629,615 | Jupyter breaks most recent Mayavi 4.8.3 | <p>For me, Jupyter(-lab) fails to work with the most recent version of Mayavi 4.8.3.<br />
Other Python interpreter software (like Spyder, ipython, ...) works well.<br />
For me, this can be boiled down to a bare-bones-test-environment, as described next.</p>
<p><strong>1)</strong> Create fresh test environment <code>~... | <python><conda><jupyter-lab><mayavi> | 2025-07-06 08:56:24 | 0 | 659 | Mark |
79,691,573 | 11,495,811 | How to pass unpacking as an input parameter to initialize a member class object in Python? | <p>For example, in the following code, I want to pass 6 parameters by unpacking <code>*num</code> to initialize a1, a2, a3 in class A and b1, b2, b3 in class B. However, there will be an error because A only has 4 members. How do I pass 6 parameters to initialize A, automatically initialize the first 3 parameters a1, a... | <python><argument-unpacking> | 2025-07-06 07:42:06 | 2 | 355 | Edward |
79,691,197 | 4,528,716 | How to refresh host mountings in flatpack environment? | <p>I'm working on Flatpak Python app, that needs to also interact with some host filesystem elements. While the application is running, another process, running outside of flatpak environment creates new mounts - overlayfs and squashfs mountings. The problem is that flatpack application doesn't detect these mountings u... | <python><linux><gtk><flatpak> | 2025-07-05 16:56:21 | 0 | 2,800 | Damian Dudycz |
79,691,109 | 123,054 | calculate diff to previous matching row in a dataframe | <p>I have a series of timestamps (+ other data) that come from 2 separate streams of data ticking at different rates, an example below (NB: the frequency of the real data has some jitter so it's not a simple fixed stride like below)</p>
<pre><code>src,idx,ts
B,1,20
A,1,100
A,2,200
A,3,300
B,2,320
A,4,400
A,5,500
A,6,60... | <python><pandas><diff> | 2025-07-05 14:36:42 | 3 | 8,600 | Matt |
79,690,825 | 2,819,689 | How is value initialized in this line of Python code? | <p>I am trying to refactor some code (for deploying on a new infrastructure).</p>
<p>Quite a big class</p>
<pre><code>class GithubOrganization(dict):
def __init__(self, organization_dict, rest_session):
self.rest_session = rest_session
super().__init__(organization_dict)
</code></pre>
<p>and this is... | <python> | 2025-07-05 06:00:17 | 1 | 2,874 | MikiBelavista |
79,690,793 | 2,311,946 | pip install using a separate build machine | <p>I have two same-architecture Linux boxes running identical versions of pypy, installed via pyenv. Consider one a "production" machine and one a "build" machine, such that the production machine cannot easily collect and configure all required build dependencies for modern source packages. I need ... | <python><pip><python-wheel> | 2025-07-05 04:27:46 | 1 | 543 | mysteryegg |
79,690,531 | 551,046 | How to access documentation of libraries like numpy, scipy etc. via pydoc offline on my workstation | <p>Everytime, I want to access the documentation of libraries that I need for my project, I have to go to their website. Python has the excellent utility called <code>pydoc</code>, but I can only access the documentation of the python standard library functions in <code>pydoc</code>. How do I store/generate/get the doc... | <python><numpy><scipy><pydoc> | 2025-07-04 17:40:05 | 2 | 306 | ksinkar |
79,690,515 | 1,999,728 | `AutoReg`'s model roots almost match learned parmaeters but do not match parameters of `ArmaProcess` generating it | <p>Minimal working example</p>
<pre><code>from statsmodels.tsa.arima_process import ArmaProcess
from statsmodels.tsa.ar_model import AutoReg
import numpy as np
roots= 1/np.array([0.1, 0.5, -0.3, 0.9, 0.18, 0.1+0.3j, 0.1-0.3j, -0.5+0.1j, -0.5-0.1j,-0.8])
proc = ArmaProcess.from_roots([],roots)
y = proc.generate_sampl... | <python><autoregressive-models> | 2025-07-04 17:22:49 | 0 | 913 | user1999728 |
79,690,330 | 3,768,871 | How to have a line break in the math mode text in plotly? | <p>Suppose you would like to have a line break in the math mode text in plotly. The following solutions have been tried, but none of them is working in different reasons:</p>
<pre class="lang-py prettyprint-override"><code>import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Box(y=[10, 14]))
fig.updat... | <python><plotly><kaleido> | 2025-07-04 14:19:16 | 1 | 19,015 | OmG |
79,690,292 | 6,930,340 | How to assign a RGB background color to a Quarto dashboard valuebox? | <p>Consider the following quarto dashboard:</p>
<pre><code>---
title: "Test"
format: dashboard
---
```{python}
#| content: valuebox
#| title: "Test Box"
dict(value=10, color="red")
```
</code></pre>
<p><a href="https://i.sstatic.net/it67vJwj.png" rel="nofollow noreferrer"><img src="https... | <python><quarto> | 2025-07-04 13:51:08 | 2 | 5,167 | Andi |
79,690,269 | 4,653,485 | Strange result when powering pandas integer series | <p>The result when powering a pandas integer Series seems wrong.</p>
<pre><code># Standard Python
42**42
# 150130937545296572356771972164254457814047970568738777235893533016064
# Pandas series, float dtype
s = pd.Series([12, 42], index=range(2), dtype=float)
s**42
# 0 2.116471e+45
# 1 1.501309e+68
# dtype: float... | <python><pandas> | 2025-07-04 13:32:51 | 2 | 14,916 | Jérôme |
79,690,252 | 458,742 | ctrl-C to terminate a pyqt application with a QOpenGLWidget | <p>My main file for a pyqt application looks like this:</p>
<pre><code>#!/usr/bin/env python3
from PyQt5.QtWidgets import QApplication
import signal
import sys
from main_window import MainWindow
if __name__ == "__main__":
signal.signal(signal.SIGINT, signal.SIG_DFL)
app = QApplication([])
window =... | <python><linux><pyqt><signals><qtopengl> | 2025-07-04 13:20:13 | 1 | 33,709 | spraff |
79,690,071 | 4,379,593 | How to kill thread in python which stuck in blocking call | <p>I tried to cancel thread with c-function <code>pthread_cancel()</code>. Also I check canceltype and cancelstate: it has default values: <code>PTHREAD_CANCEL_DEFERRED</code> and <code>PTHREAD_CANCEL_ENABLE</code></p>
<pre class="lang-py prettyprint-override"><code>import threading
import ctypes
from time import sleep... | <python><c><multithreading> | 2025-07-04 10:53:44 | 2 | 373 | Филя Усков |
79,690,013 | 13,087,048 | Automate QGIS v.kernel.rast across multiple nested folders with Python | <p>I'm using QGIS 3.40.8 and need to automate kernel density calculations across a nested folder structure. I don't know Python - the code below was created by an LLM based on my QGIS log output from running <code>v.kernel.rast</code> manually in the GUI.</p>
<p>Current working code (single folder):</p>
<pre class="lan... | <python><for-loop><automation><qgis> | 2025-07-04 10:08:06 | 0 | 403 | Nikos |
79,689,943 | 1,826,066 | Compute group-wise residual for polars data frame | <p>I am in a situation where I have a data frame with <code>X</code> and <code>X</code> values as well as two groups <code>GROUP1</code> and <code>GROUP2</code>. Looping over both of the groups, I want to fit a linear model against the <code>X</code> and <code>Y</code> data and the subtract the fit from the true data t... | <python><dataframe><window-functions><python-polars> | 2025-07-04 09:22:52 | 2 | 1,351 | Thomas |
79,689,885 | 3,668,129 | Error while installing whisper-cpp-python | <p>I'm running on:</p>
<pre><code>Ubuntu 22.04.5 LTS
python 3.10.12
cmake version 4.0.3
</code></pre>
<p>I tried to install a library with the following command:</p>
<pre class="lang-bash prettyprint-override"><code>pip install whisper-cpp-python
</code></pre>
<p>but received an error:</p>
<pre><code>Building wheels fo... | <python><pip><openai-whisper> | 2025-07-04 08:34:47 | 1 | 4,880 | user3668129 |
79,689,724 | 19,459,262 | How can I change the background color of an action button? | <p>I have a Shiny for Python app with some buttons. I want to change the color of a button. How can I do this?</p>
<pre><code>from shiny.express import ui
with ui.layout_columns():
ui.input_action_button("red_button", "Make this button red!")
ui.input_action_button("blue_button", ... | <python><background-color><py-shiny> | 2025-07-04 05:56:16 | 1 | 784 | Redz |
79,689,720 | 6,930,340 | quarto dashboard shiny package not found | <p>I have a quarto dashboard that makes use of <code>shiny</code>. The <code>test.qmd</code> file starts like this:</p>
<pre><code>---
title: "Test"
format: dashboard
server: shiny
---
...
</code></pre>
<p>When running quarto preview function within VS Code (i.e. using the shortcut <code>CTRL+SHIFT+K</code>)... | <python><quarto><py-shiny> | 2025-07-04 05:49:19 | 0 | 5,167 | Andi |
79,689,600 | 1,332,263 | How to search and match and corrent exact word in text file | <p>test.txt file contains 2 misspelled words.</p>
<p>loyai</p>
<p>royai</p>
<p>pain</p>
<p>I want to search for the misspelled words and replace them using dict words_. My problem is if a misspelled word (pai) is part of another word (pain) it corrects pain to paln when it should ignore it.</p>
<p>How can I have my cod... | <python><python-3.x><regex> | 2025-07-04 01:24:14 | 2 | 417 | bob_the_bob |
79,689,557 | 11,222,417 | How to make PEP8 formatter vscode extension to allow long lines? | <p>How to make PEP8 formatter vscode extension to allow long lines for python? Currently the formatting enforce too short lines.</p>
<p>Furthermore, I really like the auto-formatting in pycharm. Is there a way to auto format with PEP8 extension or another extension to be more similar to the ptcharm formatting, (and spe... | <python><formatting><vscode-extensions><autopep8> | 2025-07-03 23:30:25 | 0 | 305 | J. Doe |
79,689,397 | 2,540,336 | Cannot understand the behaviour of pandas case_when used on Series with different indexes | <p>I am trying to use the case_when of a pandas Series and I am not sure I understand why it behaves like below. I indicate the behaviour that looks odd to me. It seems it has to do with the index of the Series, but why?</p>
<pre class="lang-py prettyprint-override"><code>import pandas as pd
print(pd.__version__)
# 2.3... | <python><pandas><series> | 2025-07-03 19:42:11 | 2 | 597 | karpan |
79,689,261 | 11,222,417 | why TensorDataset devide the data to minibatches? | <p>Why TensorDataset devide the data to minibatches? For example, when putting in it 2D array, instead of yielding 2D tensors as batches, it sets the required batches to be minibatches, and its actual "batch" size is a list of length 1. For example, why in this example the batch size is 1 and not 3?</p>
<pre ... | <python><dataset><tensor><mini-batch> | 2025-07-03 17:32:41 | 1 | 305 | J. Doe |
79,689,252 | 9,686,427 | FuncAnimation: Fade out at the end of animation affecting fade in animations at the beginning | <p>In an attempt to fade latex text in and out of the screen using <code>FuncAnimation</code>, I have written the code below. In particular, I have written two methods <code>fade_in</code> and <code>fade_out</code> that fade an equation in and out respectively. When tested individually these methods work as expected, y... | <python><matplotlib><animation> | 2025-07-03 17:23:36 | 0 | 484 | Sam |
79,689,146 | 3,768,871 | Ignored font size of the math formula in Plotly | <p>Take the following example of code for a plot in plotly:</p>
<pre><code>import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Box(x = [r"$\mu$", r"$\sigma$"], y=[10, 14]))
fig.update_layout(xaxis=dict(tickfont=dict(size=24))
fig.show()
fig.write_image("this_image.png")
<... | <python><plotly><kaleido> | 2025-07-03 16:00:20 | 0 | 19,015 | OmG |
79,688,998 | 5,748,138 | Access an excel file in sharepoint using python to ingest into SQL sever using a dataframe - Access has been blocked by conditional access policies | <p>I presently have a .env file which holds the sql login credentials and the sharepoint login credentials.</p>
<p>My code below fails in the second section of Step two with the following error:</p>
<blockquote>
<p>An error occurred while retrieving token from XML response: AADSTS53003: Access has been blocked by Condi... | <python><azure><sharepoint> | 2025-07-03 14:21:37 | 0 | 342 | Will |
79,688,933 | 6,234,139 | How can I create a column that is the result of replacing values in two or more other columns? | <p>Consider the dataframe <code>df</code>:</p>
<pre><code>import pandas as pd
df = pd.DataFrame({'Event1': ['Music', 'Something else 1', 'Theatre', 'Comedy'],
'Event2': ['Something else 2', 'Ballet', 'Something else 3', 'Something else 4'],
'Cost': [10000, 5000, 15000, 2000]})
print(df)
... | <python><pandas> | 2025-07-03 13:34:27 | 1 | 701 | koteletje |
79,688,844 | 13,682,559 | Pyright doesn't understand implementation of protocols | <p>In my code base I have many declarations like this:</p>
<pre><code>from typing import Protocol, override
from dataclasses import dataclass
# Definition of protocols (usually in a separate file)
@dataclass
class Data(Protocol):
val: int = 1
class Programm(Protocol):
def update(self, data: Data) -> int... | <python><python-typing><pyright> | 2025-07-03 12:21:01 | 0 | 1,108 | Durtal |
79,688,618 | 3,840,940 | Can not save spark 4.0 sql dataframe into redis database (Connection reset by peer) | <p>I try to make some python codes of saving spark sql dataframe into redis database. First, my development environments are</p>
<pre><code>OS : Windows 11
Spark : Spark 4.0.0
python : Anaconda3-2024.02-1-Windows-x86_64
IDE : Visual Studio Code
</code></pre>
<p>And These are simple pyspark codes.</p>
<pre><code>from py... | <python><apache-spark><pyspark><redis><py-redis> | 2025-07-03 09:35:12 | 0 | 1,441 | Joseph Hwang |
79,688,583 | 10,715,700 | How do I process CSV files from S3 using pandas without loading the entire file? | <p>My current data processing flow looks like this</p>
<ol>
<li>Load CSV</li>
<li>Pivot Data</li>
<li>Filter the original data based on some results from previous step</li>
<li>Repeat several times</li>
</ol>
<p>I have this working on several CSV files in S3. But I am going to encounter files that can be over GBs in vo... | <python><pandas><data-processing> | 2025-07-03 09:10:06 | 0 | 430 | BBloggsbott |
79,688,514 | 12,439,683 | Why are type-checkers fine with covariant method parameters when they are in a union? | <p>Method parameters should be contravariant, hence defining a <em>co</em>variant generic should raise a type error. However when using a covariant generic in a union <a href="https://pyright-play.net/?code=GYJw9gtgBALgngBwJYDsDmUkQWEMoAqiApgGoCGIANFAOLErEhIDGNRCxAggDZLkBnGlxRwAsAChJBAPoswUALyESFEAAoARLPmaa8gG6V%2BKGIo... | <python><generics><python-typing><covariance> | 2025-07-03 08:16:59 | 1 | 5,101 | Daraan |
79,688,390 | 1,080,517 | In Airflow getting NotRegistered error on simple Celery task despite [celery] imports configuration | <p>I'm encountering a persistent NotRegistered error in my Airflow setup and have exhausted the standard debugging steps. Even a minimal test case fails, suggesting a fundamental issue with how my Celery worker is being configured by Airflow.</p>
<p><strong>My Environment:</strong></p>
<ul>
<li>Airflow: apache-airflow=... | <python><airflow><celery> | 2025-07-03 06:37:06 | 0 | 2,713 | sebap123 |
79,687,761 | 27,596,369 | How to get slice of list which is in a pandas series | <pre><code>numbers = df_data['prize_share'].str.split('/')
</code></pre>
<p>Here is numbers:</p>
<p><a href="https://i.sstatic.net/8aqHrVTK.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8aqHrVTK.png" alt="image of Series" /></a></p>
<p>(Without using .split, it would be a fraction like 1/1 or 1/4)</p>
... | <python><pandas><series> | 2025-07-02 16:14:13 | 1 | 1,512 | Aadvik |
79,687,721 | 14,409,562 | How do AI Agent workflows (langgraph) know what tools to use? | <p>Hi I'm currently trying to start to use langgraph and it's really awesome and incredible. I'm slightly confused on a certain subject though, how does langgraph identify tools?</p>
<p>How does it know what a tool does? How can I convey the purpose of the tool in order to be clearer?</p>
<p>From what I understand, its... | <python><langgraph><crewai> | 2025-07-02 15:42:13 | 0 | 412 | a_confused_student |
79,687,592 | 943,222 | merge sorted array wrong result not sure why? | <p>I am doing this challenge but I am getting two different results one on my pycharm and one on the leet code webpage.</p>
<p>my code on pycharm:</p>
<pre><code>nums1 = [1,2,3,0,0,0]
m = 3
nums2 = [2,5,6]
n = 3
print(nums1[0:m])
print(nums2[0:n])
nums1 = nums1[0:m] + nums2[0:n]
nums1.sort()
print(nums1)
</code></pre... | <python><merge> | 2025-07-02 14:28:36 | 1 | 816 | D.Zou |
79,687,543 | 2,473,898 | How to call Microsoft 365 Copilot API to perform web search using Python? | <p>I’m working on a Python application that integrates with Microsoft 365 Copilot APIs. My goal is to <strong>use Copilot (or a related API) to perform web-grounded responses (i.e., public web search similar to Bing integration)</strong>.</p>
<p>From Microsoft documentation, I understand there are:</p>
<ul>
<li><strong... | <python><azure><azure-ad-msal><microsoft365><microsoft-copilot> | 2025-07-02 13:50:58 | 0 | 531 | Banng |
79,687,525 | 5,378,816 | Field validator calls a parser - how to save the parsed value? | <p>A form has a field. The field has a validator. The validator calls a parser. If and only if the parsing succeeds, the validation is successful.</p>
<p>However, later I have to call the parser again to get the parsed value. How can I avoid this duplication? Should I attach the result to the field object as a new attr... | <python><flask-wtforms><wtforms> | 2025-07-02 13:41:26 | 1 | 17,998 | VPfB |
79,687,500 | 15,993,687 | Can label or button act as parent in tkinter? | <p>I always thought that only frame and other container elements can be parent, but recently when I tried the below code, it seemed to work perfectly without any error.</p>
<pre class="lang-py prettyprint-override"><code>import os
import tkinter as tk
from PIL import Image, ImageTk
BASE_DIR = os.path.dirname(os.path.a... | <python><tkinter><tkinter-layout> | 2025-07-02 13:28:06 | 1 | 3,141 | Art |
79,687,461 | 5,118,421 | How to prevent black adding parentheses for chain of code | <p>Given code:</p>
<pre><code>longfunc(long_arg1, long_arg2...).longfunct().longfunct().longfunct()
</code></pre>
<p>How can I prevent black wrapping it in parentheses?</p>
<pre><code>(
longfunc(long_arg1, long_arg2...)
.longfunct()
.longfunct()
.longfunct()
)
</code></pre>
<p>What rule enforces that?</p>
| <python><python-black> | 2025-07-02 13:00:04 | 1 | 1,407 | Irina |
79,687,355 | 5,520,689 | How to make the LLM call MCP functions hosted on Google Cloud Run with Python | <p>I have hosted a function on Google Could run and am able to call it with FastMCPClient.
Thank you for the help with my earlier <a href="https://stackoverflow.com/questions/79685701/how-to-call-a-python-mcp-tool-hosted-on-google-cloud-run">question</a>.</p>
<p>This is my MCP Server code. This is deployed as a docker ... | <python><https><google-cloud-run><large-language-model><model-context-protocol> | 2025-07-02 11:41:15 | 2 | 358 | Sachu |
79,687,351 | 6,010,635 | Multiclass focal loss in xgboost doesn't train | <p>I have a dataframe with 60 columns as variables and a last column as target class (4 possible classes). I want to implement a custom loss function. I want that function to be the focal loss for a multiclass problem since I have a very imbalanced dataset. This is my approach following the docs from xgboost for custom... | <python><xgboost><loss-function><xgbclassifier> | 2025-07-02 11:34:01 | 1 | 1,297 | David |
79,687,251 | 11,267,281 | How to create an OpenAI Assistant using Responses API | <p>When I try using Python Azure OpenAI SDK to create a thread for my OpenAI Assistant</p>
<pre><code>my_thread = azure_openai_client.beta.threads.create()
</code></pre>
<p>, it works but the following annoying error is shown:</p>
<blockquote>
<p>/tmp/ipykernel_1880725/4229537171.py:1: DeprecationWarning: The
Assistant... | <python><openai-api> | 2025-07-02 10:20:20 | 1 | 319 | Mauro Minella |
79,687,167 | 1,647,627 | What does Python do with incorrect type hinting in global scope? | <p>I found <a href="https://superset.apache.org/docs/configuration/configuring-superset/#keycloak-specific-configuration-using-flask-oidc" rel="nofollow noreferrer">here</a> strange Python code, something like:</p>
<pre><code>myvar: "Some string"
</code></pre>
<p>I checked it in IPython and it works. But what... | <python><python-typing> | 2025-07-02 09:16:01 | 1 | 897 | senior_pimiento |
79,687,131 | 2,819,689 | How to get branches instead of git.Head "ref/head/dev"? | <p>I am using GitPython</p>
<pre><code>from git import Repo
r=Repo(url)
repo_heads=r.heads
</code></pre>
<p>I got</p>
<pre><code>git.Head "ref/head/dev"
</code></pre>
<p>what should I changet to get the list of branches,"main",""dev"...?</p>
| <python> | 2025-07-02 08:55:03 | 1 | 2,874 | MikiBelavista |
79,686,671 | 14,000,710 | Why is pylance not able to statically determine Literal Union type in dictionary value | <p>When writing a <code>to_ChatCompletionMessageParam()</code> instance method, I have the following implementation:</p>
<pre class="lang-py prettyprint-override"><code>def to_ChatCompletionMessageParam(self) -> ChatCompletionMessageParam:
author: Literal["assistant", "user"] = self.author
... | <python><python-typing><azure-openai><pyright> | 2025-07-01 23:04:08 | 1 | 537 | feverdreme |
79,686,607 | 4,379,593 | How do I make mypy treat my class as not being a subtype of object? | <p>I'm trying to write a class in Python where comparisons like <code>MyClass(5) == 5</code> are considered type errors by mypy, even though in Python all user-defined classes inherit from <code>object</code>.</p>
<p>My goal is to:</p>
<ol>
<li>Restrict comparisons to only instances of <code>MyClass</code>, so that <co... | <python><python-typing><mypy> | 2025-07-01 21:08:01 | 1 | 373 | Филя Усков |
79,686,564 | 5,719,229 | Cannot send a request through FastAPI in Python (Failed to connect to localhost port 8000 after 0 ms: Couldn't connect to server) | <p>I devised a spam detecter for my example but I cannot send any request through Postman</p>
<p>Here is the <strong>requirement.txt</strong> file</p>
<pre><code>fastapi
uvicorn[standard]
transformers
torch
</code></pre>
<p>Here is my <strong>python file</strong> shown below</p>
<pre><code>from fastapi import FastAPI, ... | <python><docker><fastapi><pydantic> | 2025-07-01 20:17:40 | 1 | 2,928 | Sercan Noyan Germiyanoğlu |
79,686,497 | 13,828,837 | Matplotlib compiled .pgf output blurry | <p>I am generating .pgf plots in matplotlib. Here a minimal example:</p>
<pre class="lang-py prettyprint-override"><code>import matplotlib.pyplot as pyplot
import numpy.random as random
pyplot.matshow(random.random((20, 20)), interpolation="none")
pyplot.savefig("plot.pgf")
</code></pre>
<p>This cr... | <python><matplotlib><latex><pdf-viewer><pgf> | 2025-07-01 18:47:18 | 0 | 344 | schade96 |
79,686,433 | 629,530 | How are Python 3.14 t-strings different than f-strings | <p>Python 3.14 is introducing template strings, so-called t-strings. Can someone explain how these differ from f-strings? What new problems are t-strings helping developers solve?</p>
| <python><python-3.14><python-template-strings> | 2025-07-01 17:34:39 | 2 | 6,114 | firebush |
79,686,410 | 3,995,094 | What is scipy's rotation function as_matrix from quaternion based on? | <p>The scipy implementation of <code>as_matrix</code> (from quaternions) which appears <a href="https://github.com/scipy/scipy/blob/main/scipy/spatial/transform/_rotation_cy.pyx" rel="nofollow noreferrer">here</a> seems different to the usual one found in books or online (as in <a href="https://en.wikipedia.org/wiki/Ro... | <python><scipy> | 2025-07-01 17:19:03 | 1 | 641 | Anon |
79,686,388 | 8,622,814 | Leetcode Python 208 -- memory not clearing from previous test case? | <p>The problem for reference: <a href="https://leetcode.com/problems/implement-trie-prefix-tree" rel="nofollow noreferrer">https://leetcode.com/problems/implement-trie-prefix-tree</a></p>
<p>It seems straightforward enough, implement a trie. However, during one of the submission tests, where the input is</p>
<pre><code... | <python><python-3.x><algorithm><memory><memory-leaks> | 2025-07-01 16:55:07 | 1 | 2,018 | Samson |
79,686,384 | 18,476,381 | Pymongo and Beanie Incompatibility issues | <p>I'm trying to migrate from motor to pymongo's AsyncMongoClient.</p>
<p>After doing some upgrading/installing on pymongo I am having the below error when running this import <code>from beanie import Document</code></p>
<pre><code>ImportError: cannot import name '_QUERY_OPTIONS' from 'pymongo.cursor'
</code></pre>
<p>... | <python><mongodb><pymongo><mongoengine><beanie> | 2025-07-01 16:53:04 | 1 | 609 | Masterstack8080 |
79,686,332 | 27,596,369 | np.random() is getting treated as module | <p>I am trying to create a random numpy array using <code>np.random()</code> but for some reason, instead of taking it as a function, google collab is taking it as a module, I checked the documentation, but I would prefer not to have a default_rng since as to my understanding, I will always get the same array with the ... | <python><arrays><list><numpy><random> | 2025-07-01 16:07:40 | 1 | 1,512 | Aadvik |
79,686,262 | 17,945,841 | PCA with direction arrows showing genes associated with samples | <p>I’m trying to reproduce a PCA biplot where</p>
<p>dots = samples coloured by the column <code>sample</code> in <code>pb.obs</code></p>
<p>arrows = genes, pointing toward the region(s) of the plot where each gene is most highly expressed.</p>
<p>So - if a gene is associated with a certain sample, on the PCA plot the ... | <python><matplotlib><plot><seaborn><pca> | 2025-07-01 15:16:31 | 0 | 1,352 | Programming Noob |
79,686,222 | 416,104 | How to set up shiv to properly use an existent .venv site-packages and not redownload packages? | <p>I'm trying to use shiv with a project that contains a pyproject.toml in my CI.</p>
<p>This project is being built, in a previous step, by PDM with SetupTools as build-backend, and all dependencies are already in the .venv created by it.</p>
<p>I just want shiv to pack it.</p>
<p>But when it executes</p>
<pre class="... | <python><python-pdm><linkedin-shiv> | 2025-07-01 14:42:30 | 0 | 1,865 | Cristiano |
79,686,145 | 11,064,604 | PowerShell equivalent of Linux `nohup command &` - Run processes that survive terminal closure | <p>I need to run Python programs that continue running even after I close the PowerShell terminal window. In Linux bash, I use:</p>
<pre class="lang-bash prettyprint-override"><code>nohup python my_program.py &
</code></pre>
<p>This runs the program in the background and it survives terminal closure.</p>
<p><strong... | <python><powershell> | 2025-07-01 13:34:22 | 1 | 353 | Ottpocket |
79,685,872 | 6,171,575 | Python script for SOLIDserver DNS: IP/hostname update successful but "shortname" persists in Advanced Properties | <p>I'm working in small laboratory. The DNS is managed by our Institute, but we have an access to efficientIP web interface and so we could change the names of our computers.</p>
<p>But we want to automating it and so I created a little python script to change the name for a given IP using <strong>SOLIDserverRest</stro... | <python><dns> | 2025-07-01 09:57:14 | 0 | 577 | Paul Zakharov |
79,685,861 | 8,119,069 | Weird characters in Shell after importing seleniumbase | <p>I have a small annoyance with seleniumbase: after importing it, printing to the Shell window will always add strange characters like "[0m" for some reason. See the image to show what I mean. <a href="https://i.sstatic.net/2aALhcM6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2aALhcM6.png"... | <python><seleniumbase> | 2025-07-01 09:50:07 | 1 | 501 | DoctorEvil |
79,685,823 | 1,750,612 | Is there a way to mimic pip --extra-index-url functionality for transitive dependency resolution? | <p>In my corporate environment we are forced to proxy PyPI through our internal artifactory service, e.g.:</p>
<pre><code>https://[COMPANY URL]/artifactory/api/pypi/pypi-release/simple
</code></pre>
<p>I therefore set up my <code>pyproject.toml</code> with this as the primary source:</p>
<pre class="lang-toml prettypri... | <python><python-3.x><pip><artifactory><python-poetry> | 2025-07-01 09:26:11 | 1 | 359 | MikeFenton |
79,685,744 | 6,322,924 | cv2 findChessboardCornersSB not working, detects only some corners | <p>I have pictures of my checkerboard, but findChessboardCornersSB() or findChessboardCorners() cannot detect all corners, only some of them, or none, regardless of checkerboard dimensions that I input.<a href="https://i.sstatic.net/GPylrUXQ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/GPylrUXQ.png" a... | <python><opencv><image-processing><computer-vision> | 2025-07-01 08:30:58 | 0 | 607 | Falco Peregrinus |
79,685,701 | 5,520,689 | How to call a python MCP tool hosted on Google Cloud Run | <p>I have deployed a python script for mcp server in a docker container on Google Cloud Run.
Below is a sample script</p>
<pre><code>import asyncio
import logging
import os
from fastmcp import FastMCP
logger = logging.getLogger(__name__)
logging.basicConfig(format="[%(levelname)s]: %(message)s", level=logg... | <python><https><google-cloud-run><model-context-protocol> | 2025-07-01 07:53:07 | 1 | 358 | Sachu |
79,685,618 | 2,638,256 | Checking for Missing Signatures in Uploaded PDF Using Python | <p>I am new to Python and I want to check whether the uploaded PDF file contains all the required signatures. If any are missing, it should return "Signature missing." I’ve tried reading the file, but I’m not sure how to implement this check.</p>
<pre><code>try:
images = convert_from_path(pdf_path,... | <python><image-reader> | 2025-07-01 06:43:32 | 1 | 1,239 | kreya |
79,685,528 | 6,141,238 | When using asyncio, how can I throttle the rate of a dependent sequence of web requests without blocking responses to these requests? | <p>I am attempting to send out a grid, or lattice, or "matrix" of API requests using <code>asyncio</code>: For a "category 1," I may wish to request the datasets 1a, 1b, 1c. For category 2, I may wish to request the data sets 2a, 2b, 2c. And for category 3, I may wish to request the datasets 3a, ... | <python><asynchronous><async-await><python-asyncio><sleep> | 2025-07-01 04:33:37 | 1 | 427 | SapereAude |
79,685,448 | 1,850,484 | Request for Hyperledger Aries framework persistent askar wallet | <p>The default configuration for the Askar wallet in ACA-Py creates an in-memory (non-persistent) wallet unless explicit parameters are provided to make it persistent. My intention is to create a persistent wallet, so I have specified the required wallet parameters (such as <code>--wallet-type askar</code>, <code>--wal... | <python><hyperledger-indy><hyperledger-aries> | 2025-07-01 02:08:42 | 0 | 388 | user1850484 |
79,685,368 | 4,690,023 | How to accurately pick/select cells in PyVista with single mouse click? | <p>I'm trying to implement single-click cell selection in PyVista to get the correct cell index when clicking on a mesh.</p>
<p>I've tried using <code>pv.Plotter().enable_cell_picking()</code> but this has two issues: the first is that it seems to allow only rectangle selection and the callback is not returning a singl... | <python><pyvista> | 2025-06-30 23:21:58 | 1 | 1,870 | Luca |
79,685,288 | 8,318,573 | UV Workspaces Module Not Found | <p>This is my directory structure:</p>
<pre><code>myProject
├── pyproject.toml
├── apps
│ └── myApp
│ ├── pyproject.toml
│ └── main.py
└── lib
└── myLib
├── pyproject.toml
├── main.py
└── __init__.py
</code></pre>
<p>In the top level <code>pyproject.toml</code> I have the follo... | <python><uv> | 2025-06-30 21:00:45 | 1 | 589 | Abhishek Malik |
79,685,176 | 4,534,466 | Saving Spark's MLlib model using Kedro data catalog | <p>Consider the model that is trained <a href="https://docs.kedro.org/en/0.19.14/integrations/pyspark_integration.html" rel="nofollow noreferrer">this example</a> from Kedro's documentation</p>
<pre><code>from typing import Any, Dict
from kedro.pipeline import node, pipeline
from pyspark.ml.classification import Rando... | <python><pyspark><apache-spark-mllib><kedro> | 2025-06-30 18:50:00 | 1 | 1,530 | João Areias |
79,685,147 | 6,936,582 | 3D array to 2D then back again | <p>I have the array</p>
<pre><code>import numpy as np
a = np.array([[[11,12,13], [14,15,16]],
[[21,22,23], [24,25,26]],
[[31,32,33], [34,35,36]]])
# array([[[11, 12, 13],
# [14, 15, 16]],
# [[21, 22, 23],
# [24, 25, 26]],
# [[31, 32, 33],
# [34, 35, 3... | <python><numpy> | 2025-06-30 18:15:23 | 1 | 2,220 | Bera |
79,685,121 | 11,062,613 | How to efficiently wrap GSL functions with structs and pointers using Numba? | <p>I'm trying to wrap some GSL (GNU Scientific Library) functions using Numba. I'd like to avoid C glue code wrappers and to be able to cache and extend the wrapped functions.</p>
<p>Here’s a simplified structure of the site-package:</p>
<pre><code>numba_gsl/
├── numba_gsl/
│ ├── gsl_integration.c # Minimal C wra... | <python><numba><gsl><llvmlite> | 2025-06-30 17:33:10 | 1 | 423 | Olibarer |
79,685,103 | 5,616,309 | How to properly store a date time value in a sqlite3 database with python | <p>I wanted to store a timestamp from Python in a sqlite3 database. For that I used this kind of code</p>
<pre><code>from datetime import datetime, date, timedelta, time
import sqlite3
import os
def main():
script_dir = os.path.abspath(os.path.dirname(__file__))
database_file = os.path.join(script_dir, "... | <python><timestamp><sqlite3-python> | 2025-06-30 17:10:09 | 0 | 1,129 | FredericP |
79,685,012 | 6,876,422 | Azure ApplicationAccessPolicy not blocking access for certain users in Microsoft Graph API (application permission) | <p>I am using an <strong>ApplicationAccessPolicy</strong> in Exchange Online to restrict an Azure AD application’s access to only one specific mailbox (my personal account).
The goal is for the application to <strong>only access the mailbox of the user "famas@example.com"</strong>, and block access to all oth... | <python><azure><azure-active-directory><microsoft-graph-api><azure-powershell> | 2025-06-30 15:32:54 | 1 | 2,330 | famas23 |
79,684,997 | 6,546,694 | Polars reading just one file from s3 with glob patterns | <p>I have a s3 location in which I have a list of directories and each directory contains a csv named <code>sample_file.csv</code>. I am trying to read these files using a glob pattern in <code>pl.read_csv</code> but it is just reading only one file and silently ignoring the rest. The issue has been mentioned in the po... | <python><amazon-s3><python-polars><polars> | 2025-06-30 15:23:30 | 1 | 5,871 | figs_and_nuts |
79,684,967 | 11,598,948 | Efficient way to get several subsets of list elements? | <p>I have a DataFrame like this:</p>
<pre class="lang-py prettyprint-override"><code>import polars as pl
df = pl.DataFrame(
{
"grp": ["a", "b"],
"val": [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]],
}
)
df
</code></pre>
<pre><code>shape: (2, 2)
┌────... | <python><python-polars> | 2025-06-30 15:06:47 | 1 | 8,865 | bretauv |
79,684,837 | 5,568,409 | Why does `Matplotlib` issue this error with `\textbf`? | <p>I was looking to have a <strong>bold</strong> text in my annotation; many advise to use <code>\txtbf</code> so I tried this:</p>
<pre><code>import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(6, 4))
# Annotated line in bold LaTeX
ax.annotate(r"$ \textbf {y = -\,\frac{1}{\sqrt{2}}x + 1} $",
... | <python><matplotlib> | 2025-06-30 13:27:07 | 1 | 1,216 | Andrew |
79,684,576 | 21,049,944 | How to change legend patches after plotting? | <p>I have a function that is supposed to enlarge all labels in a figure to make it ready for export. However I fail to enlarge the legend properly:</p>
<pre><code>import matplotlib.pyplot as plt
def enlarge_legend(ax, fontSize = 25):
for text in ax.get_legend().get_texts():
text.set_fontsize(fontSize)
fi... | <python><matplotlib><legend><patch> | 2025-06-30 09:55:19 | 2 | 388 | Galedon |
79,684,559 | 5,617,371 | Failed to call api `https://mdmenrollment.apple.com/server/devices` use python3 | <p>I want to use python3 to call apple api, and it failed, the api document is <a href="https://developer.apple.com/documentation/devicemanagement/fetch-devices" rel="nofollow noreferrer">https://developer.apple.com/documentation/devicemanagement/fetch-devices</a></p>
<p>I suppose that I use the wrong <code>aud</code> ... | <python><apple-developer><apple-developer-account><apple-developer-enterprise> | 2025-06-30 09:38:02 | 1 | 1,215 | leo |
79,684,430 | 1,866,775 | Why does `isort` order the imports differently when renaming a directory from test to tests? | <p>In the example below, everything is already processed using <code>isort .</code> (version <code>6.0.1</code>):</p>
<pre class="lang-bash prettyprint-override"><code>tree .
</code></pre>
<pre><code>.
├── a
│ └── test
│ ├── __init__.py
│ └── test_integration.py
└── b
└── tests
├── __init__.py... | <python><isort> | 2025-06-30 08:16:52 | 1 | 11,227 | Tobias Hermann |
79,684,326 | 354,051 | embedding python in multi threaded c++ environment | <ul>
<li>python 3.13.5</li>
<li>windows 10</li>
<li>msvc</li>
</ul>
<p>This is how initialize python in main.</p>
<pre class="lang-cpp prettyprint-override"><code>#include <iostream>
#include <taskflow/taskflow.hpp> // Taskflow is header-only
#define PY_SSIZE_T_CLEAN
#include <Python.h>
int main(int... | <python><c++> | 2025-06-30 06:37:15 | 1 | 947 | Prashant |
79,684,175 | 467,054 | Setting row colors to a pandastable with setrowcolors | <p>I'm working on a script to collate information from a few utilities and applications. The last part I'm trying to finish up is to take color information and apply it to a table. My issue is that when I run this portion of the code:</p>
<pre><code> print(html_color)
... | <python><tkinter><pandastable> | 2025-06-30 02:06:49 | 1 | 480 | Loren Zimmer |
79,684,073 | 5,305,242 | Identify a column cell and perform subtraction with the same column | <p>This is just a small example DataFrame, but in reality, I’m working with a much larger and uneven dataset. I need to identify the data in pattern to perform subtraction within the same column. Please take a look at my attempt and the expected result below.</p>
<pre><code>df = pd.DataFrame([{'col1': "", 'co... | <python><pandas><data-science> | 2025-06-29 21:26:23 | 1 | 458 | OO7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.