Category "python"

How can i get raspberry pi pico to communicate with PC / external devices

For example when i give 5 to the code, i want to turn on the led in our rpi pico (rpi pico connected to pc with cable) #This code will run in my computer (test.

Problem Installing azure-pipeline due to ruamel.yaml

I am trying to install azure-pipeline using: pip install azureml-pipeline When I do this it installs most dependencies fine until I receive the following error

Why tesseract is not recognising text from this image?

I am trying to get the text from these images. When I run the code is below, in the first picture recognize "Legendary x" but the second picture doesnt recogniz

How to emulate clicking on coordinates on android in the editor on android python

On my device there is a safe from which I forgot the password and I want to sort through all the passwords through auto-clicking on python. The problem is that

Merging excel workbooks into one using xlwings

I am currently trying to merge a number of excel spreadsheets into one workbook to create a monthly master workbook. I have written the following code to try an

How to read JSON that has values in parenthesis with data type?

I have JSON file built like the following: "key" : DataType("value") Example - [ { "timestamp" : ISODate("2022-03-10T13:50:51.688Z"), "some_field" : ObjectId("

GirdSearchCV for multioutput RandomForest Regressor

I have created a multioutput RandomForestRegressor using the sklearn.ensemble.RandomForestRegressor. I now want to perform a GridSearchCV to find good hyperpara

Best way to provide admin role from Django REST to ReactJS

The default django user model has a is_superuser field. I would like to use this field to conditionally render components in react, i.e. get something like this

How to directly save spectrogram image to specific pixel size

I am generating spectrograms and casting them to images for use in a CNN. How can I directly specify the pixel size of the spectrogram. This is what I have so

1TypeError: document must be an instance of dict, bson.son.SON, bson.raw_bson.RawBSONDocument, or a type that inherits from collections.MutableMapping

I am new at pymongo, but have a decent knowledge on mongoDB So basically I have a list of strings, then I converted it into a dictionary using key as integer, s

Is there any way to animate a preexisting slider in plotly?

r = np.linspace(-1,1,1000) intervr = 1/2 theta_const = np.arange(0,90+intervr,intervr) figr=go.Figure() for i in theta_const: xr,yr,zr = coords_r(r,i) f

Install grpcio via pip: "legacy-install-failure"

I want to install grpcio with pip(version 1.35). But I get this error: note: This error originates from a subprocess, and is likely not a problem with pip. erro

Can I return a single backslash in a JSON response in FastAPI? [duplicate]

Seems like a really simple question and it's not clear what the correct answer is here. We understand that backslashes are a special delimiter

Using exec to set button image in Python - is there a better way?

I'm writing a Python code for tkinter to set various images for four different buttons. I send to the method a list of four integers, 0-3, and it sets the image

Created Field(DateTimeField) auto_now_add=True is not working in Abstract Class in Django

class TimeStampMixin(models.Model): id = models.CharField(max_length=60,editable=False,primary_key=True,default=generate_unique_id) created = models.Dat

Replacing the Opencv with my changes used by opencv-python

I am Working on a project which uses opencv-python. Due to few specifications I had to make few code changes in the opencv code( Received from open source). Now

Unable to upload file with python request

I have a form i want to fill out that contains a file and a few fields. If i do a post with just the fields values enters it works but it doesnt if i include th

Add channels to / edit existing tdms files?

I have a naive question but did not manage to find a clear answer. I have some .tdms files with channels of data. I would like to add additionnal channel of dat

Polars: how to add a column with numerical?

in pandas: df['new'] = a where a is a numerical Series or just a number. while in polars we can add a char df.with_column( [ pl.all(), pl.lit('str'

Why do I keep getting this Attribute Error?

Every time I run my code it pops up the message saying "'ICU' object has no attribute '_name'. Did you mean: 'name'?" I can not figure out how to fix it. I've t