I have a homework where I have to implement hough transform for equilateral triangles detection: The trianlges edges are of length L, so this means all the trianlges in the image are the same. What did I do? first i used canny edge detector to get the edges in the image. now i have to find a way to parameteri…
‘int’ object is not iterable while using zip in python
Error : Traceback (most recent call last): File “”, line 8, in TypeError: ‘int’ object is not iterable It works when I convert list object to string but not working in int. Answer Because indexing will give back the object and not an iterable container here. unless you call it like thi…
Kivy – Error while trying to use my.kv file
I’ve just started learning kivy and I am unable to get a black window when I run this code, and this is an error: Kivy files require #:kivy !ex This is my code snippet: gui_python.py My my.kv file is: Answer I use Builder.load_string() and paste my .kv code in it and that’s work
Multiple dates in a pandas column
I am trying to make the dates in a Pandas DataFrame all of the same format. Currently I have the DataFrame storing the dates in two formats. “6/08/2017 2:15:00 AM” & 2016-01-01T00:05:00 The column name which these dates are stored under is INTERVAL_END. As you can see, one of the dates is a st…
Finding difference in day between today’s date and a entered date
I am currently trying to construct a function that takes a date string and returns the number of days from that date until now. It will return 0 if it detects that the format is wrong, with the input date string format being Day/Month/Year (e.g. 12/3/21). The number should be negative if it is a past date (e.…
Values in Python lists getting overwritten
I am calculating some values for a certain type of matrix A of varying sizes. Namely the backward error, forward error, condition number, and the error magnification (everything with the infinity norm). My values get calculated and then I am trying to put them into lists, looping through increasing sizes of t…
Replace string between two strings with duplicate markers in string
I using python and I have a multi-line string like this: I want to replace “adamredsox24” in a large set of these types of strings with a variable (newName) but from set to set the substring will not always be “adamredsox24” at all and will be unknown to me. In other words, the substri…
Using Decompose to remove empty tag
I am trying to search for emails in HTML elements. I want to run the code so that when there are no emails found in the HTML, to search in another element in the HTML and in the end if it is not found to set email as “N/A”. I am new to writing code and I am trying to
Save screen capture in pyvista including interaction / rotation
I’m looking for a way to effectively capture the frame buffer during interaction in pyvista so that I can produce a video afterwards of the model moving around on the screen. The problem I’ve encountered is that when I click the screen to interact with the viewer/plotter, no frames are written whi…
Multiple XML files in directory Python
I am fairly new to Python and this community has been a great help! I am learning a lot. I’m trying to use this existing code to loop through multiple XML files in the same directory. Currently, the code is looking at one specific file. Any help is greatly appreciated! Answer This should help you…