Category "python-3.x"

PyQT5 - Webview load URL - Unbalanced save/restore

I try to load a page in a webview widget. I got information: QPainter::restore: Unbalanced save/restore QPainter::end: Painter ended with 2 saved states so Web

How to groupby two columns, not considering order of values there?

I have a dataframe: val1 val2 val3 a b 10 a b 2 b a 3 f k 5 f k 2 when i do df.groupby(["val1", "val

Creating an instance in OWLready2 creates a completely new class instead of asigning it to the existing class

I'm trying to create a simple ontology, following the tutorial on the official website. The code runs smoothly and everything seems fine when running this code:

How to overcome value error python model prediction?

I have trained a model and now my task was to test it on unseen images from the internet. Originally the model was trained on CIFAR-10 so for the model I chose

Python - Extract value from list of dictionaries that match a specified key

I have a list of names: names = ['london','paris'] and I have a list of dictionaries: data = [ { "_id": "ebef3cb1-9053-4d1e-b409-b682236445b7",

Can't migrate after makemigrations on django

everyone. I newbie in this field. So, After I finished makemigrations. then I migrate this error code occurs. I try to solve it but still stuck. please guide, I

Cannot create SQLAlchemy engine, getting error "loaded 'mysqldb' is not async"

I'm trying to replace Databases with SQLAlchemy 1.4 async. When I try to make the engine I get the following error: sqlalchemy.exc.InvalidRequestError: The asyn

How to handle extra data error in FastAPI

So I have the following FastAPI code: from fastapi import FastAPI app = FastAPI class Demo(BaseModel): content: str = None @app.post("/demo") async d

Print REGEX using USER DEFINED FUNCTION

I'm trying to print the variables ccb_3, nome, data, taxa and parcela using the function I defined as "ext_ccb", but when I run the code it returns 3 times (bec

Databricks dbfs file read issue

I am trying to open a file that i uploaded to the dbfs location. However, I get error while trying to open the file but I can see the file when I do a ls. Also

Opencv facing an error for tesseract module not found even after installations

Opencv facing an error for tesseract moule not found even after installations pip install tesseract opencv reinstallation also done but it wont work. opencv i

TypeError: 'module' object is not iterable in django 4

TypeError: 'module' object is not iterable in django 4 I am getting the above error, it has persisted long enough than at this point I really need help. I am u

Python Pandas - Lookup a variable column depending on another column's value

I'm trying to use the value of one cell to find the value of a cell in another column. The first cell value ('source') dictates which column to lookup. import p

function which tells whether an array is subsequence of another but 1 of the loop isnt working

def is_subsequence_array(array, sequence): for num in sequence: if array.count(num) != 1 : output = False for i in range(len(sequence) - 1

How to load data from multi-level nesting object

``` when i do the School.objects.filter() query , how to load student object in single query using School.objects.filter() ``` class School(models.Mode

PyQt5 problems with CMD

i need some help . I tried to install PyQt5 with CMD in window but when i enter pip install pyqt5-tools , i got this error : enter image description here how c

CPython Script Executor does't work on Pentaho Kettle

Hellow Guys First of all, i'm using the windows 10, java_1.8.0_333, and Pentaho 9.3 I'm trying to many ways to run my Python code in Pentaho, but isn't work. I

Functional Programming: How does one create a new column in a multi-index data frame that is a function of another column?

Suppose the below simplified dataframe. (The actual df is much, much bigger.) How does one assign values to a new column f such that f is a function of another

How to change array rows places whithouth numpy

Hello everyone here is my code: n =[[34,2,55,24,22],[31,22,4,7,333],[87,74,44,12,48]] for r in n: for c in r: print(c,end = " ") print() sums=[]

I have plotly dash app, and get this error: Cannot read properties of null (reading 'layout')

I have web app in plotly dash. I have 3 dropdown and graph with selected item. When I change category i have error: Cannot read properties of null (reading 'lay