Category "python"

AttributeError: 'LinearRegression' object has no attribute 'coef_'

I am self-studying machine learning and python. I am using sklearn and I want to plot the regression line, but I get the attributeError: 'LinearRegression' obje

extracting number with decimal points from text extracted from pdf files

I need to extract only numbers with a decimal point from the following string. I used re module but faced a problem with a number of commas(there can be no comm

How to specify github link as requirements for buildozer

I know that I can specify the version of a module in buildozer.spec as requirements = python3==3.7.x #Just an example But I am using a module whose new releas

Optimized way to implement XOR between floats for huge 2D array data

I need to implement xor between floats in python for huge 2D array data (like thousand row by thousand column matrix). I use the following implementation: impor

Best way to pass random answers in Django Quiz App

I'm trying to build quiz app based on Cornell Notes, where the keywords will be the question with 4 answers (one correct answer and three random from other keys

What is the appropriate way to access data from Python sets?

If a set that always consists of one element (the element is an element of a custom class which contains different data types) is returned by a function, what i

Google Cloud Secret Manager - Create a secret in a region

I'm working with the Python library google-cloud-secret-manager and I'm facing some problems in creating a secret within a defined region. In the method secretm

How to remove outliers from the list of timedelta objects? Python 3

I have a list of timedelta objects like timedelta(seconds=345) and I need a pythonic way to remove outliers from it. For instance I may have: timedelta_list = [

Python, Pandas and intersection - not PIVOT

This isn't a straightforward pivot question. I don't want to create new named columns (or numbered ones). What I am looking for is to find a way to search for

how to replace the particular column value using python

Input Data Frame output data frame in output, some particular column should be replace and other value of other column should be repeated

Optimising model.parameters and custom learnable parameter together using torch.optim gives non-leaf tensor error

Framework: PyTorch I am trying to optimise a custom nn.parameter(Temperature) used in softmax calculation along with the model parameters using a single Adam op

Skipping unspecified blank rows when importing xls in python

I have xls files which I cannot control the format of. They have data of varying number of rows, then several blank rows at the bottom. I can get them to import

start script with arguments sys.argv

Im trying to start this script with a argument. When i start the script from a terminal i want to type "python test.py C:\Users\etc\etc\log.log count" to run fu

How can I send an image with a caption using Telethon in python?

I'm aware I can use this client.send_file(receiver, '/path/to/photo.jpg') to send an image, but how can I attach a caption to the image?

Python + Selenium(Chrome): Expansion timeout on slow computers

I'm trying to load an extension(Metamask) into chrome to do some automated stuff. It works just fine on on my gaming grade rig, but both my laptop as well as my

Even after installing cvzone Im unable to import HandDetector from cvzone.HandTrackingModule

import cv2 from cvzone.HandTrackingModule import HandDetector web_cam= cv2.VideoCapture(1) while True: success,img = web_cam.read() img = cv2.flip(img,1) #disp

How to make legend items bold in plotly

I am able to bold the axis title and ticks using update_xaxes,but is there a way to do the same for the items in the legend? import plotly.express as px df = p

Convert TensorFlow Keras python model to Android .tflite model

I am working on an image recognition project using TensorFlow and Keras, that I would like to implement to my Android project. And I am new to Tensorflow... I w

Why the injected wavenumber can't match with the 2-D plot?

I want to inject a 2D travelling wave into a sensor system for seismic data analysis. To do this, I inject a 2D sine wave of known parameters (wave numbers (lam

How can I sort a list of strings in ascending order of numeric part

I have a list of paths which have multiple numerical parts within them, here is part of it: 'C:\\Python\\Python310\\Scripts\\mockup_test\\17mm.JPG', 'C:\\Python