Quantcast
Channel: Active questions tagged python - Stack Overflow
Browsing all 16862 articles
Browse latest View live

How to create a regular expression to partition a string that terminates in...

The strings are of the form:Item 5. Some text: 48Item 5E. Some text,The result of the search should produce4 groups as follows.Group(1) = "#"Group(2) = "5" or "5E"Group(3) = "Some text"Group(4) = "48"...

View Article


How to Retrieve Data from an MySQL Database and Display it in a GUI?

all. I'm still pretty new to coding, not having written a single piece of code in my life until 4 weeks ago, and I have 2 questions.First, I've been struggling trying to figure out how to pull specific...

View Article


Typing a function decorator with conditional output type, in Python

I have a set of functions which all accept a value named parameter, plus arbitrary other named parameters.I have a decorator: lazy. Normally the decorated functions return as normal, but return a...

View Article

Instagrapi recently showing HTTPError and UnknownError

I wrote a bot to help post some vacation photos, and it had been working well for a few months, but lately I've been getting the following error:Traceback (most recent call last): File...

View Article

How to store a date/time in sqlite (or something similar to a date)

I'm coding up a To-Do List website that asks the user for the task, the importance of the task (choose between two options: low, high) and the due date for said task. The plan is to show the user a...

View Article


Azure Machine Learning pin python version on notebook

Looking for a way to use Python 3.10 on a compute resource associated to Azure ML StudioIt appears 3.10 is available with ML Studio and we select 3.10 with SDK2 from the kernel selection dropdown but...

View Article

Image may be NSFW.
Clik here to view.

Calculating center of rotation from Affine2D transformation matrix

I have two 2D images, where the second one undergoes translation and rotation, resulting the coordinates (xn, yn) in the first picture to move to (xn', yn').I have no problem obtaining the rotation...

View Article

What is the proper way to format a multi-line dict in Python?

In Python, I want to write a multi-line dict in my code. There are a couple of ways one could format it. Here are a few that I could think of:mydict = { "key1": 1,"key2": 2,"key3": 3, }mydict = {...

View Article


Evaluating the goodness of a fit with uncertainties

I have many arrays of (very) noisy data, and I am trying to fit each with a double gaussian. Some of the arrays don't have nearly a high enough signal/noise to properly fit the data, and I wish to cut...

View Article


Seeking Python Libraries for Removing Extraneous Characters and Spaces in Text

I am developing a project that involves processing text data. My goal is to correct errors specifically related to unnecessary characters and spaces in texts. I'm looking for recommendations on...

View Article

Python C Extension - Error in `python3.6': free(): invalid pointer: 0x

I've been learning about extending Python with C and I finally got it to work in some way, but I'm getting this really weird error. I made a test module with a single function to test if a number is...

View Article

Advanced Indexing For 2D Numpy Array

I have a 2D numpy array of size [N, M] = A.I'm trying to select an element from each row based on some criteria.I already have all the indices in an array of size [N, 1] = B, where each element in this...

View Article

Run .exe file in python with geany

I’m using python on geany and would love to know how I could get it to run a .exe file on my computer. Wait 10 seconds then run a hotkey.Its running no errors but just not doing anything.also would it...

View Article


How do I install Turicreate on macOS, Python 3.8?

I try to run this on macOS:pip3.8 install turicreateI have:Python 3.8.6and pip 24.0 from (python 3.8)Update: The initial output showedinstalling to build/bdist.macosx-14-arm64/wheelReopened the...

View Article

How to make this while loop to stop?

When I run the code the while loop it is supposed to stop when number = 2 but it never stops. I use github codespace to run codeimport timeimport randomGet = 0Trys = 0while Get == 0: time.sleep(0) Trys...

View Article


Keras similarity calculation. Enumerating distance between two tensors, which...

I follow the Nicholas Renotte tutorial "Build a Deep Facial Recognition App"(Python). But at the part 4 I faced a problem, here is the code:Siamese L1 Distance classclass L1Dist(Layer): # Init method -...

View Article

How to fix the issue with some post functions not working during autopagination?

I need help solving a problem with automatic pagination. When automatic pagination occurs from the home_list.html template to the home.html template, all functions of the template stop working, even...

View Article


How to extract graph node embeddings from a Pytorch-Geometric GAT model?

Dataset Strucute: Temporal directed graph; Nodes have features; Edges don't have features; Nodes are labelled. Using the Elliptic DatasetTask: Classify nodes/ Predict node labels.Data Structure: 2 .csv...

View Article

How to run llama-cpp-python in a Docker Container?

I have a more conceptional question about running llama-cpp-python in a Docker Container. Following a lot of different tutorials I am more confused as in the beginning.I have a Debian 12 Server with a...

View Article

PyTorch: AttributeError: 'torch.dtype' object has no attribute 'itemsize'

I am trying to follow this article on medium Article.I had a few problems with it so the remain chang eI did was to the TrainingArguments object I added...

View Article
Browsing all 16862 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>