Category "python"

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

How to Make Keypresses Using PyAutoGUI

I am using PyAutoGUI to try to code a macro. For this macro, I need to press a key to select something. To interact with the screen, I am using PyAutoGUI. Any i

Evaluating Dots and Noise in an Image

I have an image that consists of small black dots, and in each dot's vicinity there is some noise that appears as grayish smudge. I'm trying to use some sort of

I want to create a profile for every user that is registered. I am using dj-rest-auth for authentication

models.py from django.db import models from django.contrib.auth.models import User Create your models here. class Profile(models.Model): user = mode

How do I structure if-statements for maintainability?

I have a package for a very specific purpose that is imported into many other systems and it consists of a lot of if statements. Is there a way of rewriting the

simple-salesforce bulk query takes hours for a simple soql

My bulk query has been taking hours in production today. Before this, it takes only a few minutes. Just wondering what might be the issue? This takes 2 hours (T

403 Forbidden error when getting cat images

I just finished programming a dog photo program, and after a few issues it works fine. I decided to make a modified version that uses a different api to give ca

remove highlight color when choosing a combobox value tkinter python

Is there an option to remove the color highlighting when the user chooses the value from the combo box drop down? I'm using the theme "clam" and tried other the

Replace a rectangle with an Image in Pygame

I am new to pygame and python in general. Today I was trying to code a simplified TopDown movement. I did it and it runs without any issues. But i've got a prob

Why does the print function return None?

I'm trying to understand why the outer print returns None. >>> a = print(print("Python")) Python None >>> print(type(a)) <class 'NoneType'

Convert base 36 value to base 10 value [duplicate]

How can I convert a base 36 value to base 10? Base 36 value: lgzl0 We need to convert this value to 36064548. Are there any built-in functions

Ordered (n choose p) binary encoding and decoding

I want to 'impose' order on (n choose p) binary and be able to encode/decode items. Below you can see an example of p=2. For p > 2 it will need more loops. B

ModuleNotFoundError: No module named in another submodule

I have read a couple of threads on StackOverflow but did not find any answer that has fixed my problem. I'm pretty new to Python and cannot figure out how does

stable match algorithm for different sizes groups and limited places

I want to write a program that oriented student to their specialty in university depending on their choices and their range in the specialty. each specialty can

How to do a race between multiprocessors in python

I have a function that factor a number. It depends on some random condition. So what I am trying to do it's to run multiple processors in this function and the