Skip to main content

Question list filters

Filter by
Sorted by
Tagged with
Score of 0
0 answers
57 views

When rendering a Quarto document with jupyter: python3, calling sklearn's learning_curve() with n_jobs=-1 crashes with a TerminatedWorkerError. The same code runs fine in a plain Jupyter notebook. ...
Score of 0
1 answer
85 views

I am trying to fit a curve with curve_fit() in scipy using a function with multiple independent variables and multiple fitting parameters. However, the function is the integral of a single-variable ...
Score of 1
1 answer
105 views

In Python 3.13 I can do this: >>> x: int >>> Which passes. But this raises NameError: >>> x Traceback (most recent call last): File "<stdin>", line 1, in &...
Score of -3
1 answer
69 views

What is the function of '[T]' in this code? class Box[T]: def __init__(self, content: T): self.content = content And here, why is Box subscripted? str_box = Box[str]('Python')
Score of -4
1 answer
138 views

When should a module define __all__ vs using the underscore invention? Should this be done manually or dynamically? Ideally, we could answer this once and for all with 'write it all out manually' and '...
Score of -11
0 answers
126 views

Is there a way to differentiate between a variable containing a plain string and one containing an expression, like an isexpression function? For example how can I establish between these two: test1 =...
Score of 0
0 answers
30 views

I am trying to use pydicom to store a float as a field DS. It appears that it should be working automagically since issue 1264 has been closed: https://github.com/pydicom/pydicom/issues/1264 However I ...
Score of 0
1 answer
35 views

I am brand-new to NiceGUI and I am trying to learn it for Python by following some tutorials to learn basic features. I have been trying to replicate the CSV file upload and show content by ...
Score of 0
2 answers
93 views

According to PEP 8, class names should use the UpperCamelCase (CapWords) convention. However, I have seen classes use lowercase names. For example, in the standard library: class socket(_socket.socket)...
Score of -5
0 answers
121 views

The (now deprecated) 'py' launcher can be installed via an option in the (also deprecated) Python Installer. It then appears as its own entry in Windows Settings > Apps > Installed Apps. I ...
Score of -4
0 answers
114 views

Starting from Python 3.16, traditional executable installers will be phased out in favour of the Python Install Manager. I tried using the Manager to install a Python 3.13 runtime via py install 3.13. ...
Score of 4
2 answers
74 views

This script is trying to thread both the root.mainloop() function for the window and the UpdateBoard() function to do logic in for the game. It is currently throwing an incoherent error about some ...
Score of 2
2 answers
104 views

After working on this answer, I have a cached class to have simple singleton behavior: import functools from dataclasses import dataclass @functools.cache @dataclass(frozen=True) class Person: ...
Score of 0
1 answer
58 views

I am trying to run a script which uses GradientBaseLLM. Apparently the script was written by someone else couple of years back and I having tough time upgrading. I am importing from llama_index.llms ...
Score of -6
0 answers
158 views

I am implementing a 3-layer dense neural network from scratch using NumPy for a regression problem. I am not using TensorFlow, PyTorch, Keras, or any neural-network library because I want to ...

15 30 50 per page
1
2 3 4 5
146971