Category "python"

Download AWS RDS Data using Python After a certain Timestamp

I have an RDS database where there is a single sql table and new timeseries data shows up in it every 3 hours. I am trying to make a python script that pulls me

Creating New Columns in Pandas based on subtracting two variables based on value from different indexes

I have a DateFrame df which contains Open High Low Close Volume and Date data for every minute for the past ten days. **open** high low **close** volume

AttributeError: 'str' object has no attribute 'tk' when click button [duplicate]

Here is my code: window = tk.Tk() version = tk.Label(text="hi", fg="orange", bg="black",

Python3: Import Module over Package

I'm looking for suggestions to import a module over a package in Python3. I don't have control over the names of the files so changing them is not an option. Ad

Update an element in faiss index

I am using faiss indexflatIP to store vectors related to some words. I also use another list to store words (the vector of the nth element in the list is nth ve

How to print result in one line [duplicate]

I am trying to solve a problem with this code: equipoa = input("Digite las iniciales del equipo a: ") equipob = input("Digite las iniciales de

Show the center coordinate of the object tracking bounding box

I would like to know how I can print the tracking coordinate rectangle onto the video. I want the coordinate of the center point of the rectangle and, of course

IS kivy a good python module?

so i was making an kivy app but then thought is there any module better than it?

How can i prevent my label from stretching when i resize the window in kivy?

In this program when i want to resize the window i do not want to my label to resize or stretch and i want it to have fixed width How can i do that? (I set the

Attempting to write data from PYSIMPLEGUI application to xlsx and it keeps throwing UnboundLocalError

def main(): window1, window2 = make_win1(), None # start off with 1 window open while True: # Event Loop window, event, values = sg.read_

How to create if and catch (exception)for this code of scrapy

so I want to scrape the data of multiple URLs and retrieve all the information. but I can only scrape from 1 URL if more than 1 URL will be an error (list index

Python - adding number to a value returned by a function

Following code correctly displays number 31: str = 15 print(str+16) Following code also correctly prints lengths of each column in a pandas' dataframe: df = pd

Function returns no value - web scraping [closed]

I am trying to web scrap data from otodom without selenium/scrapy. Problem is, function getnextpage does not fetch any information on the pag

Error "takes 1 positional argument but 2 were given" when Tkinter slider callback

I am trying to use Tkinter sliders and buttons to adjust variables. Somehow when I move the slider, it gives this error message below. I have self on each of th

Attempting to use np.insert in a created class which has subscripts yields "object does not support item assignment" debug

I have defined my own class which takes in any matrix and is defined in such a way to convert this matrix into three numpy arrays inside a parenthesis (which I

Strange bug when cycling dog photos

I have this code that generates a dog photo and can cycle through them. import tkinter, urllib.request, json, io from PIL import Image, ImageTk main = tkinter.

How to solve Tesseract installation error?

I am trying to use this function: pytesseract.image_to_string(img) However the following error is appearing: enter image description here I installed it : enter

I am training Yolov5 on OID dataset and I'm getting these errors, "Caught KeyError in DataLoader worker process 0" and "KeyError: 'copy_paste'"

So this is my error, I am using the OID dataset for training using the YOLOV5 model. As a reference, I'm using this article: https://blog.paperspace.com/train-y

Model definition does not give any output

from sklearn.linear_model import LogisticRegression logmodel = LogisticRegression() logmodel The output of the above code is just LogisticRegression() But I e

Sympy blanket initial condition (or assumption?)

I'm using Sympy 1.10.1 in Jupyter. Some cells look like: import sympy as sp x = sp.Symbol('x') y = sp.Function('y')(x) y.diff(x) diff_eq = sp.Eq(y*y.diff(x), 4