Category "python"

How i can find a specific row and look for the minimum element index in a numpy array

I got a numpy array from a csv file. It is 6 X 6. I want to find a specific row and then find the lower element index.

Pymeshfix Error while trying to repair a stl file

If i try to repair an input stl file (https://www.file-upload.net/download-14916065/waxup_slm_cad.stl.html) with the library pymeshfix (https://github.com/pyvis

Client seems to hang after a specific reply from server

I am implementing an authentication process between a server and a client in order to exchange some information. I have created a function called serverToClient

How to define the pen width in the menu bar

I am trying to write the code for my own paint program. I have added the menu for few basic color options. Now I would like to add the same menu style pen width

How to rotate a rectangle/bounding box together with an image

I'm working on a data augmentation and im trying to generate synthetic version of every image in my dataset. So i need to rotate images and together with boundi

Python Image Library and Tkinter Clashing

I have an issue where PIL and Tkinter are not working together in the same program. Basically, I tried to run my program and when it was on the line 'image.open

Fastest way to remove white background from image/video

I need to make the below faster as I need it to run on a video. Basically I am trying to remove a white background on a video and then overlay that onto another

Updating database after reordering Datatable

I'm struggling with the datatables reordering. I want when user reorder to update table in the database. For this to happen i need: to configure the datatable t

Some one can explain to me how this code executes ? I still mess up with recursion

That output is supposed to be 4,3,2,1 right? def test(x): if x > 0 : test(x - 1) print(x) test(4) #output => 1 #output => 2 #output => 3 #outp

automatically remove items of a list every few second in redis

I'm trying to see how many users used my bot in the last 5 minute. I've got an idea to every time a user used my bot I add his/hers id into a redis list with a

run function file in google colab

In Google Colab, how can I execute the function file related to the original code? In the main code is part of the function that is in the file. PY is another,

Extracting rows from list in data frame where at max numbers [duplicate]

So i've been given a pandas data frame and created a definition for the maximum variable in one column. max_energy = D202['USAGE'].max() max_e

matrix with nodes that refer to which openings/connections they have

I would like some help on a problem that has been stressing me for a while now It revolves around recurdive backtracking maze generation, but should reurn a mat

How to make ball bounce off of triangle in Py.Processing?

Im building a game in processing python. It is similar to pong except the paddles can rotate thus changing the direction of the ball. There is also supposed to

How can I plot a pandas dataframe where x = month and y = frequency of text?

I have the following dataset: Date ID Fruit 2021-2-2 1 Apple 2021-2-2 1 Pear 2021-2-2 1 Apple 2021-2-2 2 Pear 2021-2-2 2 Pear 2021-2-2 2 Apple 2021-3-2 3 Apple

Add elements in a list at the n index of a other list

calibres_prix =['115-135', '1.87'], ['136-165', '1.97'], ['150-180', '1.97'], ['190-220', '1.97'], ['80-95', '1.42'], ['95-115', '1.52'], ['150-180', '1.82

TypeError: forward() missing 1 required positional argument in a method

I use the following model: model = DeepGraphInfomax(128, pos_summary_t).to(device) which looks like: class DeepGraphInfomax(torch.nn.Module): def __init__(s

Installing python package from private gitlab repo in Dockerfile

I'm currently trying to install python packages from a private gitlab repo. Unfortunately, I get problems with the credentials. Is there any way to install this

How to get conf value from airflow dag?

I want to get conf value from dag area. "{{ dag_run.conf['company'] }}" is recognized as a string. How can I get this value? Values ​​are passed fin

Python, typeerror about string and bytes

I used Youtube API and got list of comments. And trying to change it into single string so I can use konlpy. a = str(' '.join(c)).encode("UTF-8") But I got