Category "python"

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

Problems with Django URL routing

I'm building a website, to be used in dental practices, however I'm having trouble with the URL routing. I'm wanting af URL pattern like: Denthelp/kartotek/#nam

Checking for Duplicates twice over in a File - Python

config.yml example, DBtables: CurrentMinuteLoad: CSV_File: trend.csv Table_Name: currentminuteload GUI image, This may not be the cleanest route to

Pytorch get "reduced" tensor by indices

I have a tensor a = torch.arange(6).reshape(2,3), and another tensor b=(torch.rand(a.size())> 0.5).int().nonzero(). I want to create a new tensor that contai

Pythonic way to control an attribute over another attribute

There is a pythonic way to control attributes? I wan't that the init method is clear, trying to avoid to use a function like: self.a = check_a_greater_than_b(a)

how to train yolov3 on custom dataset

i want to train yolov3 on this dataset https://www.kaggle.com/datasets/mangosata/exclusivelydarkimagedataset-from-cschan i have a text file for each image conta

ERROR: Failed building wheel for pystan in Anaconda distribution. How to fix this error?

When trying to install Darts library its dependencies Pystan and Prophet were throwing errors: ERROR: Failed building wheel for pystan Building wheel for prophe

HTTP retrieval failure when creating drop-in audio chat using Twilio

I am leveraging the Twilio Programmable Voice API to create a drop in audio chat room when a user completes a signup form. I am using ngrok to listen to both my

How to get progress of file upload using requests.post() if the file was just uploaded via form-data? (Not sure whether this is a streaming process)

Suppose I'm running some kind of web service with python & flask aiming to provide file upload. It should be noted that my service is only a kind of transfe