Category "python"

Getting "error while generating package metadata" when installing TkFontAwesome

I'm trying to install TkFontAwesome using python -m pip install tkfontawesome, but always get the following error: Collecting tkfontawesome Using cached tkfon

Generating multiple labels for documents

Currently, i am working on a task where we are scraping pages from web and trying to generate labels for each webpage. For that, we have extracted the text data

Xpath using using random.randint(2,8) always identifies the first item using Python Selenium

Working on a random question picker from a codechef webpage but the problem is even when i am using random value of i, it always clicks the first question. Code

How to delete certain number from a list in list using the index in python?

I have a list in a list, and I am trying to delete the third number of each sublist, but every time I am getting an error TypeError: list indices must be intege

cv2.error: OpenCV (4.5.3) occurs in raspberry pi

I tried to test Picam with the code below with Raspberry Pie. import cv2 def main(): camera = cv2.VideoCapture(-1) camera.set(3,640) camera.set(4,4

How to delete certain number from a list in list using the index in python?

I have a list in a list, and I am trying to delete the third number of each sublist, but every time I am getting an error TypeError: list indices must be intege

How do I know which endian to use in struct.unpack() when converting hexadecimal string to float?

I have data in form of hexadecimal string and I convert it to float as: import struct, binascii a = '0X437A1AF6' x = struct.unpack('>f', binascii.unhexlify(s

Apply negative lookbehind to the entire group before it

I want to capture the model of a phone but not the storage in the title. So I don't want the regex to match xxxGB. I am expecting to match: iphone 13 from: "iph

Apply negative lookbehind to the entire group before it

I want to capture the model of a phone but not the storage in the title. So I don't want the regex to match xxxGB. I am expecting to match: iphone 13 from: "iph

Why scipy.integrate.quad returning odd values for integration of a normalised sinc function instead of 1 in python?

While I was trying to approximate a normalised sinc function as a delta function and integrate it using quad from -infinity to infinity , it is returning me som

how to reduce a list of tuples, return a concrete number

I was wondering what is wrong with my code, it now has a typeError: 'float' object is not subscriptable # this function is to calculate Weighted Average Maturit

Get user id by forwarded message (telebot)

I can't solve the problem: I can't get the id of the user whose message I forwarded to the bot. When i forward a message i get my id. I'll be glad to help!!!! M

How can I print more links from the HTML DOM using Python Selenium?

Html: <div class="xxxx"> <a href="ooooo.pdf"></a> </div> Python selenium code trials: from selenium.webdriver.support.ui import WebD

How to scrape weight of player which is a hidden content using Selenium

I have been trying to get the weight of this player, but it is only visible on the inspect element and not on the website, when I print the below, I get a blank

SHAP not working with LightGBM categorical features

My model uses LGBMClassifier. I'd like to use Shap (Shapley) to interpret features. However, Shap gave me errors on categorical features. For example, I have a

How to scrape weight of player which is a hidden content using Selenium

I have been trying to get the weight of this player, but it is only visible on the inspect element and not on the website, when I print the below, I get a blank

How can i use slenium in Python to click the button?

I try to find how can I click on button for accept cookies with a python in selenium, I used a lot of convinations but nothing works :( This is the element: &l

add_page() not accepting the parameters for width and height of the page in FPDF

I was converting a number of images to pdf using FPDF in python, however doing: pdf.add_page('P',x,y) (x and y are well defined and have values, pdf = FPDF())

Tornado error about attributes when deploying a server

I'm trying to run a program that works with Tornado (https://github.com/oduwsdl/CarbonDate), however, when I try to deploy a server with it, I get multiple erro

Tornado error about attributes when deploying a server

I'm trying to run a program that works with Tornado (https://github.com/oduwsdl/CarbonDate), however, when I try to deploy a server with it, I get multiple erro