Category "python"

Error "takes 1 positional argument but 2 were given" when Tkinter slider callback

I am trying to use Tkinter sliders and buttons to adjust variables. Somehow when I move the slider, it gives this error message below. I have self on each of th

Attempting to use np.insert in a created class which has subscripts yields "object does not support item assignment" debug

I have defined my own class which takes in any matrix and is defined in such a way to convert this matrix into three numpy arrays inside a parenthesis (which I

Strange bug when cycling dog photos

I have this code that generates a dog photo and can cycle through them. import tkinter, urllib.request, json, io from PIL import Image, ImageTk main = tkinter.

How to solve Tesseract installation error?

I am trying to use this function: pytesseract.image_to_string(img) However the following error is appearing: enter image description here I installed it : enter

I am training Yolov5 on OID dataset and I'm getting these errors, "Caught KeyError in DataLoader worker process 0" and "KeyError: 'copy_paste'"

So this is my error, I am using the OID dataset for training using the YOLOV5 model. As a reference, I'm using this article: https://blog.paperspace.com/train-y

Model definition does not give any output

from sklearn.linear_model import LogisticRegression logmodel = LogisticRegression() logmodel The output of the above code is just LogisticRegression() But I e

Sympy blanket initial condition (or assumption?)

I'm using Sympy 1.10.1 in Jupyter. Some cells look like: import sympy as sp x = sp.Symbol('x') y = sp.Function('y')(x) y.diff(x) diff_eq = sp.Eq(y*y.diff(x), 4

Getting the same HREF link instead of different HREF links with Selenium

This is the first time I'm making a website scraper and I'm relatively new to programming in general. So I'm trying to get the HREF links for all the subpages o

Neural network: same prediction for different inputs

I am getting the same prediction for different inputs. I am trying to use a regressional neural network. I want to predict values instead of class using neural

How to use custom labels from Django models.Choices field together with enum.auto?

Before Django v3.0 I used to use enum.Enum together with enum.auto (see reference) for my choices fields. The reason was mostly so I could use my enumeration cl

Get_queryset() missing 1 required positional argument: 'request' when i'm trying to filter objects by logged in user

I'm trying to list all facilties owned by a user on a "facility list page" using the django rest framework and react. I tried the following to make this happen

'Product' matching query does not exist

this is the views code, the item is in the database but it still brings DoesNotExist, i have also tried get_object_or_404 im trying this url http://127.0.0.1:80

Is it possible to extend pydantic models generated using datamodel-code-generator?

I am using the datamodel-code-generator to generate pydantic models from a JSON schema. Here is the JSON schema used. And the generated models after running the

How to remove constant prefix and suffix character [duplicate]

I have a data frame where numeric data is stored in String with some Prefix character which I need to remove. On top of this it has double quo

Python Tweepy - limit doesn't work properly

i am trying to scrape data with Tweepy, but i find out, that the limit is not working properly and i don't know, why. user = 'LudekStanek' limit = 1 api = tweep

How to group column which respects certain conditions

I try since this afternoon to group column which respects certain conditions. I giva an easy example, I got 3 column like it : ID1_column_A ID2_column_B

How to upload a 62 GB datasets to google colab

I am new to processing large datasets, new to google colab. I have a 62 GB datasets and I zipped it uploaded it to the Files section of google colab. Before upl

Duplicate letters in wordle

For a school project I have to create a wordle in Python. The program I created compares the letters of the target word and the guessed word. An example: the ta

Convert xls to xlsx with excess headers

junior dev here. Goal: Using python, convert file type from xls to xlsx that contains a clean header. Desired header: My attempt: My first attempt was to use w

Option for dataframe-image module (convert a styled DataFrame to image) that the creator stopped updating and supporting

Always the best answers here from the community and that the image is perfectly formatted, that perfectly fits the columns according to the data, without loss o