Category "python"

Running Spyder '5' on Debian 11

Why does calling spyder as 'root' on cli execute the spyder '5' version software, while doing the same as a normal 'user' executes spyder '4'? How do I make it

How to calculate the percentage of overlap between 2 ranges with python

I would like to calculate the percentage of overlap between 2 ranges. for example: I have two lists x and y x ['567.630', '592.927'] y ['593.000', '618.297'] In

Python Scrapy unable to get each class name with its value from each div

I'm trying to get each class names with its corresponding value from each div listing. From this page: https://www.dotproperty.id/en/properties-for-sale/riau-is

Kivy: Quality of images

i have programmed a little a Kivy/Python-program that opens an image and displays it. But it can cleary be seen, that there is a drop in image quality 2, when c

python code working fine in my parrot os but showing error on ubuntu

code working fine on parrot os but showing error on ubuntu def count_down(count): count_min = math.floor(count/60) count_sec = count%60 if count_min<10:

How can I fix this error in my avatar command that I'm getting?

I need to fix this error, I'm not very good with APIs. I am keen to understand how to fix it, since I'm trying to learn Python. The code: @client.command() asyn

i am not getting the required output it tells "say something" "speechrecognition could not understand audio" "say something"

import speech_recognition as sr import gtts from playsound import playsound import os r = sr.Recognizer() ACTIVATION_COMMAND = "hey sam" def get_audio():

Allocating external text, icon, and image files so that Python Script can function on multiple PCs?

I've been having this main issue in my code i've been trying to compile. I am trying to make a GUI-based application, utilizing the tkinter and pandas libraries

Pandas combine two columns with delimiters

I have two columns which have delimiters: column1 column2 a,b,c,d e,f,g,h h,i j,k l,m,n o,p,q ... ... I am trying to group them as ae

Assertion error during deep neural network image classification

# GRADED FUNCTION: two_layer_model def two_layer_model(X, Y, layers_dims, learning_rate = 0.0075, num_iterations = 3000, print_cost=False): """ Impleme

No error logs in /var/log/nginx/error.log [nginx]

The nginx on my Google Linux server is not printing error logs in the file /var/log/nginx/error.log. The content of my /etc/nginx/sites-available/app file is: s

Deep neural network gives a constant value as output

I have implemented a neural network from scratch. I have taken random values as both input and output. When I use a single layer( with sigmoid activation) the n

Input 0 of layer sequential_2 is incompatible with the layer: expected ndim=3, found ndim=2. Full shape received: (None, 1)

model = Sequential() model.add(LSTM(100, input_shape = [X_sequence.shape[1], X_sequence.shape[2]])) model.add(Dropout(0.5)) model.add(Dense(1, activation="sigmo

TKInter Option list to run a command to move to next level

I have attempted to create a function that will look at the current value in the OptionList and run the assigned code depending on its value. Here I have set-up

Trying to make images as sprites in pygame

Why isn't this code working? I'm trying to create a class to quickly create players for my game in pygame. I was trying to create a sprite based on what he did

Random Lottery Number Generator without repeat sets?

Random gen() picks a repeated number, the same number as 33, 33, in a list. I want to get a different list from numbers [0.99]. What method should be used to fi

Unit testing for python function-using post requests and get requests

I am trying to test the below function using unit test mocks but i am not able to do it since the return type from request get/post is of type <class 'reques

How to count word occurrences in a text column against values in another column?

I have a data frame with a column of text and another column (score) that describes a score for the text and a column (score_label) that provides a label 'b' or

Tkinter Button That Stops Thread

I'm trying to make a discord bot that I can start and stop using tkinter. I have a tkinter button that runs a thread which turns on the bot and since I have a s

How to see what can be set/updated on an issue?

I'm trying to use the JIRA Python API to create and update issues on different projects. Currently I'm after timetracking but I've seen other fields that cannot